Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 02-10-2009, 05:57 AM   #1
Registered: Jan 2009
Posts: 114

Rep: Reputation: 17
Question Backups Using Tar (Question)

I found this script (thanks to some cool guy at IBM) which will backup the entire file system into one .tgz file and puts the current time/date as name on it, except I get errors when it tries to tar folders like /sys or /dev etc, (I think). it ends saying:
tar: Error exit delayed from previous errors!?
(whatever that means?)
So I put the --exclude in the line;

tar czvf --exclude='*.tgz' --exclude='/sys' --exclude='/dev' --exclude='lost+found'  $1.$(date +%Y%m%d-%H%M%S).tgz $1
exit $?
As you can see there are too many --exclude= in there and it makes it messy.

Is there any way I could use only one --exclude switch and then put all the files/folders I want to exclude in that one instant?

sorry if it's too easy for some of you , this is new to me.

Last edited by Matey; 02-10-2009 at 05:59 AM.
Old 02-10-2009, 06:02 AM   #2
Registered: Jul 2008
Location: São Paulo - Brazil
Distribution: Fedora 17
Posts: 97

Rep: Reputation: 15
Have you tried using only one exclude and listing all the folders separated by space?

Old 02-10-2009, 06:36 AM   #3
Senior Member
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 63
It seems to depend on what you call messy. In my opinion, your solution is more messy than several --exclude…

Old 02-10-2009, 06:38 AM   #4
Senior Member
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 63
You should have a look at --exclude-from=FILE

Last edited by theYinYeti; 02-10-2009 at 06:41 AM.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
tar archival backups arbis Linux - Software 2 10-20-2008 09:24 PM
backups using tar and rsync cucolin@ Linux - Server 2 04-03-2007 12:25 AM
Tar for backups ? Proper syntax ? Reefcrazed Linux - Newbie 8 02-21-2006 05:18 PM
tar or cpio - Which is better for tape backups? Br. Nicholas Linux - Software 2 07-02-2003 04:06 PM
Incremental tar backups Pepe Linux - General 5 03-18-2002 03:31 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:25 PM.

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