Re: How to exclude a dir. with tar

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

 



On Thu, 01 Feb 2007 15:32:58 +0100, Guillaume wrote:

> Hi list...
> 
> I try to make a script to save my computer. I would like tu use tar to
> create a  file and then compress it.
> I have a directory to save located in a home dir, but inside it a temp dir I
> dont want to save. I try the --exclude option of tar to discard this one,
> but it don't seem to work.
> Someone can help me?
> 
> Can i use in the same way the ' -X option to exlude more than 1 dir?
> 
> tar --acls --append --exclude /home/web/current/temp  -vf
> /data/save/save.tar /home/web/current/ >> /data/save/sauve.log
> 
> Thanks for your help.
> Guillaume
> Hi list...<br><br>I try to make a script to save my computer. I would like tu use tar to create a&nbsp;&nbsp;file and then compress it.<br>I have a directory to save located in a home dir, but inside it a temp dir I dont want to save. I try the --exclude option of tar to discard this one, but it don&#39;t seem to work.
> <br>Someone can help me?<br><br>Can i use in the same way the &#39; -X option to exlude more than 1 dir?<br><br><span style="font-style: italic;">tar --acls --append --exclude /home/web/current/temp&nbsp;&nbsp;-vf /data/save/save.tar /home/web/current/ &gt;&gt; /data/save/sauve.log
> </span><br><br>Thanks for your help.<br>Guillaume

Someone already explained how to use exclude with tar, so I won't repeat
that. I just want to point out that you may want to try rsync instead of
tar. It does incremental updates (i.e. it will only copy the files that
have modified since the last update), so it saves A LOT of time and cpu if
you have big things to backup. It also has an exclude option just like tar. 
I use it as a cron job hourly, and it works wonderfully.

For instance

rsync -av --exclude=".mozilla/firefox/*/Cache" /home/amadeus /backup/home

will backup /home/amadeus to /backup/home in archive mode (-a), verbose
(-v) and will exclude the mozilla cache directory. 

Oh, yeah, and you can use it to transfer the files between different
machines (using ssh).

rsync -av source user@xxxxxxxx:destination

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux