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 namesRedirect 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. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1/M3EACgkQ3kWu7Tfl6ZQuRQCgk7Qy9TZPmBCTaDhGlUTogABg kF0AoJdhL41XdA0UUrlUfhHmXi6umRSF =IvTi -----END PGP SIGNATURE-----
On 03/15/2011 10:25 AM, Rainer Traut wrote: ...> tar: Removing leading `/' from member namesAdd -P to include leading / Mogens -- Mogens Kjaer, mk at lemo.dk http://www.lemo.dk
On Tue, Mar 15, 2011 at 5:25 AM, Rainer Traut <tr.ml at 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-backupTry this: 20 23 * * * tar -zcf /mnt/backupInternalHosts/backup/backup.tar.gz -C / etc root/home && touch /tmp/state_backup-backup
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. -- Les Mikesell lesmikesell at gmail.com
Possibly Parallel Threads
- Asymmetric encryption for very large tar file
- [supermin PATCH 0/2] Create a really empty base.tar.gz
- R260 cross-compilation
- [supermin PATCH 2/2] prepare: create a really empty base.tar.gz with no config files
- Feature Suggestion - scp don't decrypt file at destination unecrypt on copy back switch