View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 4 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Thu Jan 22, 2009 4:06 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
Any tar gurus out there? I've been using tar to backup my system and I'm wondering what switch I need to through into my line to have tar IGNORE my symlinks. Anyone?

Here is the syntax I've been using, but again, it will follow any symlinks which I do NOT want :)

Thanks!

Code:
tar zcvfp backup-system.tar.gz /etc /boot /root /home

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 22, 2009 6:19 pm 
Offline
Joined: Wed Nov 16, 2005 8:55 pm
Posts: 1381
Location: Farmington, MI USA
Not sure what you are really after here, as I believe tar normally doesn't follow symlinks, but see the -h option here if you are trying to backup the files/directories your symlinks are pointing to and not the actual link.

If you are trying to ignore symlinks altogether (as in no reference to them or the files/directories they point to whatsoever), you may want to use find with the -H or multiple -t, -e -d options in conjunction with cpio. man find for more information.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 22, 2009 7:23 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
I think the -h switch will do the trick. Thanks. BTW, the output of a simple, 'man tar' wasn't that useful. There is a great online manual for tar over at gno.org. MUCH more descriptive.

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 23, 2009 3:29 am 
Offline
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location: Germany
Actually, the -h will follow symlinks, which I don't think is what you want. Without the -h, the symlinks will be saved, not the files or dir they point to.

When you extract the files, are you sure it isn't a symlink that is extracted? It will look exactly like the original. Example:

Code:
allen@violet:~$ ls -al etc/lircd.conf
lrwxrwxrwx 1 allen allen 20 Jan 23 09:09 etc/lircd.conf -> /etc/lirc/lircd.conf
allen@violet:~$


To get it to completely ignore symlinks will probably require the use of "find".

_________________
ASUS AT3N7A-I (Atom 330)
TBS 8922 PCI (DVB-S2)


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu