SlackwareThis 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.
The tar version is 1.14. According to the man page '-h' means 'don't dump symlinks; dump the files they point to'. Out of curiosity (and I'm asking this honestly), why do you think that '--no-recursion' will only work with the '-h' option?
Note: I just added '-h' and it didn't seem to make any difference.
I apologize for not explaining the situation better. I'm tarring three directories, all containing a number of files and subdirectories containing files. I just used '/directory' in the original post as a placeholder. In two of the directories I'd like to avoid recursion, while in the third one I need recursion.
I just tried
Code:
tar -cvvf backup.tar --no-recursion myDirectory/*
(substituting my directroy path of course) and tar still descends into and copies files in subdirectories.
Perhaps I don't understand the concept of recursion?
Last edited by Earl Parker II; 08-16-2004 at 12:14 AM.
No you seem to be understanding it correctly, though if your statements are accurate it is a mystery to me. I tested with -cvvf and -cvlpf multiple times (though always a single directory) and it worked, copying just the files and the immediate subdirectories. So I have no idea.
EDIT: I am using tar 1.14 as well (from Slack 10 if it makes a difference)
OK, I've narrowed down the problem a bit. When I enter
Code:
tar -cvvf backup.tar --no-recursion /directory/*
it works just fine. If I enter
Code:
tar -cvvf backup.tar --no-recursion /directory/* /directory/subdirectory/*
it also gives the desired result. However, if I enter
Code:
tar -cvvf backup.tar --no-recursion /directory/* /directory/subdirectory/* --recursion /directory/subdirectory/*
then --no-recursion appears to be ignored and --recursion is applied to all subdirectories. According to the tar info page this should work but for some reason it doesn't. Any thoughts?
Last edited by Earl Parker II; 08-16-2004 at 12:38 AM.
Originally posted by Earl Parker II Thanks for replying.
The tar version is 1.14. According to the man page '-h' means 'don't dump symlinks; dump the files they point to'. Out of curiosity (and I'm asking this honestly), why do you think that '--no-recursion' will only work with the '-h' option?
Note: I just added '-h' and it didn't seem to make any difference.
Because of the layout it gives in tar --help
Not really a good reason, I admit, but to me
it looks like some sort of "grouping" ... other-
wise I wouldn't have an explanation for the
'chaotic' way the help output comes across.
Funny you should mention that becuase I've been experimenting with that in the last few minutes. What I've found is this: if you specify '--no-recursion' first, then '--recursion', everything defaults to '--recursion'. The reverse is also true. Whichever comes last in the tar command- '--no-recursion' or '--recursion'- becomes the default. I'm getting the feeling that I'm either leaving something out or the command simply doesn't work the way the info page states.
Instead of creating one command to do all the directories why not
tar the recursive directory or non-recursive directories first then
append the other directorie(s). Do a a check on the tar command and if it succends then tar the remander.
Not trying to anticipate you but that was just about my next move. '--no-recursion' and '--recursion' just don't seem to play well together.
If I understand correctly the idea is to create the first tarball then create the secondar tarball and append it to the first- am I understanding correctly? If not, let me know. I'll give it a try later today.
Last edited by Earl Parker II; 08-16-2004 at 12:12 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.