Hi List,
hope this is not too offtopic, but this bothers me and my backup.
My backups are tar jobs in cron, eg:
20 23 * * * tar -zcf /mnt/backupInternalHosts/backup/backup.tar.gz /etc /root /home && touch /tmp/state_backup-backup
This always sends me an unwanted email with:
tar: Removing leading `/' from member names
I consider this a bug because this informal message is printed to error out?
Ok, I rewrite my tar job to get around this:
tar -zc -f /mnt/backupInternalHosts/backup/backup.tar.gz -C / etc root home && touch /tmp/state_backup-backup
Fine this works, but problems arise when I try to exclude things (example under /tmp/foo):
$ mkdir dir1 dir2 dir1/dir2 $ touch dir1/dir2/importantFile $ tar -cvf tarfile.tar --exclude=dir2 -C /tmp/foo/ dir1 dir2 dir1/
Because the exclude pattern matches under dir1 my important File is not backed up. The problem is, I cannot specify the exclude pattern to match only /tmp/foo/dir2 , can I?
Thx Rainer
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Rainer Traut said the following on 15/03/11 10:25:
This always sends me an unwanted email with: tar: Removing leading `/' from member names
Redirect the stdout/stderr to some file:
tar cvzf /mnt/mybackup.tgz /foo /bar > /var/log/backup 2> /var/log/backuperrors
Because the exclude pattern matches under dir1 my important File is not backed up. The problem is, I cannot specify the exclude pattern to match only /tmp/foo/dir2 , can I?
It's a matter of personal taste, but I find more useful the -X (or - --exclude-from) option
Ciao, luigi
- -- / +--[Luigi Rosa]-- \
You cannot achieve the impossible without attempting the absurd.
Am 15.03.2011 10:37, schrieb Luigi Rosa:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Rainer Traut said the following on 15/03/11 10:25:
This always sends me an unwanted email with: tar: Removing leading `/' from member names
Redirect the stdout/stderr to some file:
tar cvzf /mnt/mybackup.tgz /foo /bar> /var/log/backup 2> /var/log/backuperrors
Yes Luigi, I know how to do this... but cron has the ability to send mail (I only want to see real error messages) and tar just does not behave right - no output if no error occured.
Because the exclude pattern matches under dir1 my important File is not backed up. The problem is, I cannot specify the exclude pattern to match only /tmp/foo/dir2 , can I?
It's a matter of personal taste, but I find more useful the -X (or
- --exclude-from) option
Yes, personal taste, but in crontab confusing not seeing the excludes and besides that it has the same problem.
Rainer
On Tue, Mar 15, 2011 at 7:53 AM, Rainer Traut tr.ml@gmx.de wrote:
Am 15.03.2011 10:37, schrieb Luigi Rosa:
It's a matter of personal taste, but I find more useful the -X (or
- --exclude-from) option
Yes, personal taste, but in crontab confusing not seeing the excludes and besides that it has the same problem.
Not just personal taste. You might not see what's excluded in the crontab but it works.
On 03/15/2011 10:25 AM, Rainer Traut wrote: ...
tar: Removing leading `/' from member names
Add -P to include leading /
Mogens
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Mogens Kjaer said the following on 15/03/11 10:56:
tar: Removing leading `/' from member names
Add -P to include leading /
...and be VERY CAREFUL when you unpack that tar ;)
Ciao, luigi
- -- / +--[Luigi Rosa]-- \
Luke: I don't believe it. Yoda: That is why you fail. --Empire Strikes Back
At Tue, 15 Mar 2011 10:56:58 +0100 CentOS mailing list centos@centos.org wrote:
On 03/15/2011 10:25 AM, Rainer Traut wrote: ...
tar: Removing leading `/' from member names
Add -P to include leading /
You really don't want to do that! Makes restoring to an alternitive location difficult.
Mogens
On Tue, Mar 15, 2011 at 5:25 AM, Rainer Traut tr.ml@gmx.de wrote:
Hi List,
hope this is not too offtopic, but this bothers me and my backup.
My backups are tar jobs in cron, eg:
20 23 * * * tar -zcf /mnt/backupInternalHosts/backup/backup.tar.gz /etc /root /home && touch /tmp/state_backup-backup
Try this:
20 23 * * * tar -zcf /mnt/backupInternalHosts/backup/backup.tar.gz -C / etc root/home && touch /tmp/state_backup-backup
Am 15.03.2011 12:37, schrieb Nico Kadel-Garcia:
On Tue, Mar 15, 2011 at 5:25 AM, Rainer Trauttr.ml@gmx.de wrote:
Hi List,
hope this is not too offtopic, but this bothers me and my backup.
My backups are tar jobs in cron, eg:
20 23 * * * tar -zcf /mnt/backupInternalHosts/backup/backup.tar.gz /etc /root /home&& touch /tmp/state_backup-backup
Try this:
20 23 * * * tar -zcf
/mnt/backupInternalHosts/backup/backup.tar.gz -C / etc root/home&& touch /tmp/state_backup-backup
Hmm, I already did? tar -zc -f /mnt/backupInternalHosts/backup/backup.tar.gz -C / etc root home && touch /tmp/state_backup-backup
But the problem with it is, as soon as you use excludes this can be dangerous because they can match everywhere in your backup path.
Rainer
Rainer Traut wrote:
Nico Kadel-Garcia:
Rainer Trauttr.ml@gmx.de wrote:
Hi List,
hope this is not too offtopic, but this bothers me and my backup.
My backups are tar jobs in cron, eg:
20 23 * * * tar -zcf /mnt/backupInternalHosts/backup/backup.tar.gz /etc /root /home&& touch /tmp/state_backup-backup
Try this:
20 23 * * * tar -zcf
/mnt/backupInternalHosts/backup/backup.tar.gz -C / etc root/home&& touch /tmp/state_backup-backup
Hmm, I already did? tar -zc -f /mnt/backupInternalHosts/backup/backup.tar.gz -C / etc root home && touch /tmp/state_backup-backup
But the problem with it is, as soon as you use excludes this can be dangerous because they can match everywhere in your backup path.
Check out the GNU Tar Reference manual, much more informative than "man tar". Look for CACHEDIR.TAG and --exclude-caches, works very well for me. The CACHEDIR.TAG file is added to any directory you want to skip, and tar will skip it. Here's the contents:
$ cat /var/cache/CACHEDIR.TAG Signature: 8a477f597d28d172789f06886806bc55 # This file is a cache directory tag created by (application name). # For information about cache directory tags, see: # http://www.brynosaurus.com/cachedir/
On 3/15/11 4:25 AM, Rainer Traut wrote:
Hi List,
hope this is not too offtopic, but this bothers me and my backup.
My backups are tar jobs in cron, eg:
20 23 * * * tar -zcf /mnt/backupInternalHosts/backup/backup.tar.gz /etc /root /home&& touch /tmp/state_backup-backup
This always sends me an unwanted email with:
tar: Removing leading `/' from member names
I consider this a bug because this informal message is printed to error out?
Cd into the top directory and back up '.'. Or above it and use the name without the leading /. Absolute paths are a bad idea in backups and tar is correct in telling you that you made an error.