Re: tar exclude question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Rainer Traut wrote:
> Nico Kadel-Garcia:
> > Rainer Traut<tr.ml@xxxxxx>  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/

-- 
Charles Polisher
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux