![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| exclude a line | big123456 | Shell Programming and Scripting | 3 | 04-24-2008 09:31 AM |
| 'find' and 'tar' combination | kharen11 | Shell Programming and Scripting | 2 | 02-06-2008 05:17 AM |
| du (exclude files) | the_learner | UNIX for Advanced & Expert Users | 1 | 07-17-2007 11:06 AM |
| Exclude & Zip | dreams5617 | Shell Programming and Scripting | 1 | 02-11-2007 05:01 PM |
| tar: how to exclude subdirectories? | kymberm | Filesystems, Disks and Memory | 7 | 10-15-2002 12:53 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Getting 'tar' to exclude
I want 'tar' to exclude certain dir's.
tar cvf ............. ............ does the whole lot, but I want to exclude the 'log' dirs. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Quote:
does this help? tar cvf filename.tar Create a tape (tar) archive Description: Creates a tape (tar) archive. * (c) Create * (v) Verbose mode * (f) File * (-I include_file) - List of files to archive Example: tar cvf htmlFiles.tar -I htmlFiles Submitter: Robert Weeks (Source Sun BIGAdmin) |
|
#3
|
|||
|
|||
|
Thank you.
I back up to a hardrive which I've mounted to ./backup using 'tar cvf' and that works fine and very fast. It's just that I run a system with a lot of extensive logfiles, which I do not need to back up. They are in the middle of things, so I want to exclude these. It says that tar accepts exclusions, but I cannot find the right way of putting down the command. It's Solaris 8 |
|
#4
|
|||
|
|||
|
tar cfX tarball.tar exclude_file -I include_file
|
|
#5
|
|||
|
|||
|
Thanks!
I now use the syntax: 'tar cvf tarball.tar include_file' Can I use: 'tar cvf tarball.tar include_file -X exclude_file' instead of your proposed syntax ??? |
|
#6
|
|||
|
|||
|
I hope so, but I dun think so
|
|
#7
|
||||
|
||||
|
I tried to exclude ex1.sh from tar ....
May not be viable solution. Code:
$chmod 400 ex1.sh
$tar -cvf 1.tar .
$ tar -xvf 1.tar
x .
x ./abc
x ./file1, 0 bytes, 0 media blocks.
x ./file2, 0 bytes, 0 media blocks.
x ./bcd
x ./bcd/file1, 0 bytes, 0 media blocks.
x ./hhh
x ./1.tar, 0 bytes, 0 media blocks.
tar: 0511-188 Cannot create ./ex1.sh: The file access permissions do not allow the specified action.
$chmod 755 ex1.sh
|
||||
| Google The UNIX and Linux Forums |