Slackware This Forum is for the discussion of Slackware Linux.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
11-29-2005, 07:28 PM
#1
Member
Registered: Oct 2005
Posts: 65
Rep:
Tar won't exclude directories.
I've been trying to get the whole backup thing down the past couple days with tar. The exclude option has been giving me problems though.
I've been trying to use this command
tar -zcvpf /archive/full-backup-`date '+%d-%B-%Y'`.tar.gz \
--directory / --exclude=mnt --exclude=proc --exclude=var/spool/squid
taken from
http://www.tldp.org/LDP/lame/LAME/li...er-backup.html
Even though the exclude options are there it still tries to archive mnt, proc, and var/spool/squid
I'm running a relatively clean install of Slackware 10.2.
11-29-2005, 08:05 PM
#2
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,627
It could well be that you're not invoking that line
from the root directory? If you don't try to prepend
all of the excluded directories with a / :}
Cheers,
Tink
11-29-2005, 08:12 PM
#3
Member
Registered: Oct 2005
Posts: 65
Original Poster
Rep:
I've tried running it from / , prepending a / to all the directories and both of them together. Still no luck.
11-29-2005, 08:26 PM
#4
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,627
Well ... the other thing I overlooked the first time around ...
where do you tell tar WHAT to backup in the first place?
What is that command backing up?
Cheers,
Tink
11-29-2005, 08:37 PM
#5
Member
Registered: Oct 2005
Posts: 65
Original Poster
Rep:
Oooops, I excluded the period at the end in the post, but it's definately in my command line.
I'm trying to backup my whole system.
Last edited by yougene; 11-29-2005 at 08:40 PM .
11-29-2005, 10:39 PM
#6
Member
Registered: Oct 2005
Posts: 65
Original Poster
Rep:
After tinkering with this a little bit I found that taking out the \ after the file name excluded the directories but now every directory starts with period(e.g ./bin).
tar -zcvpf /archive/full-backup-`date '+%d-%B-%Y'`.tar.gz --directory / --exclude mnt --exclude proc --exclude var/spool/squid .
What does that \ do? Are those periods in front of the directories going to be a problem when trying to restore?
11-29-2005, 10:47 PM
#7
Senior Member
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145
Rep:
That \ is used to tell bash that the command spans to another line, it's usually used inside scripts. If you're running the command on a single line, then, you don't have to use it.
The ./ inside tar is fine.
11-30-2005, 03:06 PM
#8
Member
Registered: Oct 2005
Posts: 65
Original Poster
Rep:
Oh good.
Will the tar need any special commands since it has the period in front of every dir, or will this one do?
tar -zxvpf /archive/full-backup-09-October-1999.tar.gz
11-30-2005, 03:48 PM
#9
Senior Member
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145
Rep:
Probably it needs --directory / too
12-01-2005, 09:32 AM
#10
Member
Registered: Oct 2005
Posts: 65
Original Poster
Rep:
Yeah it did
Thread Tools
Search this Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT -5. The time now is 10:19 AM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News