![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Create an Ignite image on tape from Online IgniteUX image | Andrek | UNIX for Advanced & Expert Users | 3 | 02-28-2007 04:14 PM |
| selective positions from a datafile | ganapati | Shell Programming and Scripting | 10 | 09-19-2006 06:09 AM |
| Selective Umask | baanprog | UNIX for Advanced & Expert Users | 3 | 08-03-2006 06:48 AM |
| echo is selective? | rgard | Shell Programming and Scripting | 0 | 12-01-2005 01:47 PM |
| Using `tar` for a selective backup. | Cameron | Filesystems, Disks and Memory | 2 | 07-16-2002 06:10 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I'm creating a tar image containing selected files held in a manifest file thus: cat <manifest file> | xargs tar -cvpf tar.out I need to preserve the directory as well as the file perms. When my list contains no separate directory lines, the directory is created implicitly when the first file is "untarred", but with incorrect permissions. My initial solution was to create a list entry for the directory. This preserves the dir perms, but of course grabs the entire directory contents. Is it possible to tar up a directory entry without tar descending into it? I'm on IRIX 6.5.6. Thanks in advance. Gary Farley. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
No you can't tar a directory and leave its contents behind.
And I have more bad news for you: that xargs thing is not going to fly. A command like: cat filelist | xargs rm will run the rm command once if it can fit everything on one line. But if it needs to, it will run several rm commands until it has used up the args. That's fine for rm. But tar is another matter. If you run two tar commands like: tar cvf xx.tar a1 a2 a3 tar cvf xx.tar bfile you will get a tar archive with just bfile in it. The second run is overwriting the first. Sorry for the bad news. |
|
#3
|
||||
|
||||
|
I have some good news for you.
the -A option of the tar helps you to add a file to you archive. rgds penguin
__________________
War doesnt determine who is right, it determines who is left |
|
#4
|
|||
|
|||
|
contd...
Thanks both of you for the input.
I checked the xargs point about max command line, and my backups will fit within the limit (script needs to be clearly commented though...). So using the standard tar, it looks like I don't have many options. I started looking at GNU tar, which has a --no-recursion option and will update the thread later...
__________________
Gary Farley. |
|
#5
|
|||
|
|||
|
result
Using GNU tar (1.13) solves the problem.
Simply create an additional entry in the manifest file for the directory, and use --no-recursion. Thanks for your help.
__________________
Gary Farley. |
|||
| Google The UNIX and Linux Forums |