![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Filesystems, Disks and Memory Questions involving NAS, SAN, RAID, Robotic Libraries, backups, etc go here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| list the files but exclude the files in subdirectories | shyjuezy | UNIX for Dummies Questions & Answers | 8 | 10-15-2008 10:42 AM |
| exclude a line | big123456 | Shell Programming and Scripting | 3 | 04-24-2008 09:31 AM |
| Exclude & Zip | dreams5617 | Shell Programming and Scripting | 1 | 02-11-2007 05:01 PM |
| Exclude a directory to tar | ust | UNIX for Dummies Questions & Answers | 1 | 10-12-2005 01:35 AM |
| Getting 'tar' to exclude | kuultak | UNIX for Dummies Questions & Answers | 6 | 02-07-2005 04:31 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
tar: how to exclude subdirectories?
If i have a bunch of directories that i normally backup with this:
tar cvhf /dev/rmt/0 /export/home How can i exclude certain subdirectories under the /export/home? tar cvhf /dev/rmt/0 /export/home | grep -v 'test' ? will that exclude anything named test, and any subdirectories under test? |
| Forum Sponsor | ||
|
|
|
#3
|
|||
|
|||
|
tar again
Hmm, i followed that thread, came up with some useful info
BUT i ran the following: find /export/home /etc /usr | egrep -v "test/" > list.txt tar cvhf /dev/rmt/0 'cat list.txt' doesn't work. doesn't like the cat in there. what am i doing wrong? |
|
#4
|
||||
|
||||
|
I think you're using single quotes when you want back quotes.
Don't use ' when you want ` |
|
#5
|
|||
|
|||
|
tar exclude
aha, this worked:
#>find /export/home /etc /usr ! -type d -print | egrep 'test/' > Exclude.txt then #> tar cvfX backup.tar Exclude.txt /export/home /etc /usr 2 step process. Actually 3 cuz I have to put it on tape, but could put on tape in the 2nd process, skip the tar file. |
|
#6
|
|||
|
|||
|
quotes in tar
Darn, this got me before!~ on the date command. THe confusing thing is that ' works in the egrep part of the statement, but have to use ` for the cat part of it! but it says argument listing too long. hmm.
tar cvf /dev/rmt/0 `cat listing.txt` is what i put in. what do you think it's not getting? |
|
#7
|
||||
|
||||
|
This trick will not work for lengthy lists of files. Yours is too long.
|
||||
| Google The UNIX and Linux Forums |