tar and symlinks?
Hi all
I'm trying to create a tar backup of some directories. They've got symlinks in them, however, to directories I don't need to backup. Can I tell tar to skip these linked directories when creating the backup? Thanks. |
Hi,
Tar does not have an exclude symlinks option, you need to be creative. An example: tar cf - `find . ! -type l` > tst.tar The find command gets all files (current dir and above), except links (! -type l), all files found are given to tar and put in tst.tar. Hope this helps. |
If they are symlinks to other filesystems, then maybe you could use tar's -l option?
Tar also supports adding exclusion patterns, if that helps. If those don't help, use druuna's technique (ie give a list of files - without the symlinks - to tar), either via stdin or via a file and the --files-from option. |
All times are GMT -5. The time now is 03:52 AM. |