Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-28-2003, 03:54 PM   #1
LQ Newbie
Registered: May 2003
Location: B.C
Distribution: Libranet
Posts: 10

Rep: Reputation: 0
Tar syntax

I have read the manual but still cannot seem to get the syntax correct to do the following.
I want to backup /home using TAR and EXCLUDE all references to 'cache' or any web like cookies, history etc...
I can sucessfully run tar but my /home seems to bloat to ~2GB and thus cannot write to a CDR.
In that vain, how can I get TAR to split up this ~2GB file into 3 or 4 separate tar files while it is archiving it in the first. If I use SPLIT then I run out of disk space on my distribution drive.

Thanks in advance,

Old 10-28-2003, 04:14 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
Tar, for all I know, will only allow multi-volume
backups to tape. You can look for star on (it's from Schilling, the maker of
the cdr-tools).

As for the exclusion: you can't use wildcards,
if you need to exclude lots of stuff do something
find /home/ -iname "*cache*" > /tmp/not_these.txt
find /home/ -iname "*other_stuff_I_don't_want*" >> /tmp/not_these.txt
tar -X /tmp/not_these.txt -cvzf /tmp/home.tar.gz /home
Old 10-28-2003, 05:28 PM   #3
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Sidux, LinHES, and Mythbuntu
Posts: 209

Rep: Reputation: 32
It might be easier to add the files you want to the tar file.
tar -czvf backup.tgz documents/ stuff/ more_stuff/ porn/ downloads/ windows/
for more compression use bzip2, tar -cjvf backup.tar.bz2 /stuff more_stuff/ ...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 03:48 AM
tar tar cvf - . | (cd /root/; tar xvf -) ewt3y Linux - General 10 02-19-2014 11:55 AM
Tar for backups ? Proper syntax ? Reefcrazed Linux - Newbie 8 02-21-2006 06:18 PM
gave wrong syntax for tar as tar -cvzf file file.tgz how to recover the file gautham Linux - General 4 04-13-2005 04:15 AM
Tar syntax to backup system... robbow52 Debian 5 08-05-2004 12:35 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:01 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration