Computing.Net > Forums > Linux > Tar exclude files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Tar exclude files

Reply to Message Icon

Name: Six
Date: May 2, 2003 at 14:04:21 Pacific
OS: Gentoo
CPU/Ram: 1.3 512
Comment:

Is there an easy way to tar my whole partition minus one directory? I have a 6gb /usr/games which I don't want included in my backup.tar.

thanks




Sponsored Link
Ads by Google

Response Number 1
Name: Balram Adlakha
Date: May 2, 2003 at 14:42:05 Pacific
Reply:

use --exclude=[pattern]

for example, tar -xvf filesystem.tar --exclude="games" /

This will make filesystem.tar tarring the whole filesystem except anything that has "games" in it.

There are more options but I don't remember them. Just do "tar --help | less" or "man tar" for more info.


0

Response Number 2
Name: David Perry
Date: May 2, 2003 at 19:59:33 Pacific
Reply:

tar cvf tarbar.tar `find . | grep -v 'games/'`


0

Response Number 3
Name: Six
Date: May 2, 2003 at 21:48:35 Pacific
Reply:

ah, I found the easiest way after searching around more before I saw your replies. Thanks though.

tar -X tar.exclude -cvjpf backup.tar.bz2 /*


With this being an example tar.exclude file:
/mnt
/tmp
/usr/src
/usr/portage/distfiles
/var/tmp
/proc
/usr/games



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Tar exclude files

installing tar.gz files www.computing.net/answers/linux/installing-targz-files/1996.html

Creating a .tar.gz file www.computing.net/answers/linux/creating-a-targz-file/18025.html

OPENING a .tar.gz file on redhat www.computing.net/answers/linux/opening-a-targz-file-on-redhat/12811.html