|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
'find' and 'tar' combination
I'm trying to tar the files I get from the 'find' command result. However I can't make it run successfuly? This is for our archiving process.
Here is my script: find /mnt/LOGS -mtime -10 -name "TUXLOG.*" -exec tar -cvf /mnt/LOGS/combine.tar {} \; Im not sure why it is not working or it is even possible to use the 'tar' command with exec. Appreciate your help. |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
You command "find /mnt/LOGS -mtime -10 -name "TUXLOG.*" -exec tar -cvf /mnt/LOGS/combine.tar {} \;" with the "-c" recreate for each file founded par find another "combine.tar". Better way to create a temporay file : Code:
find /mnt/LOGS -mtime -10 -name "TUXLOG.*" > combine.lst tar -cvf /mnt/LOGS/combine.tar -L combine.lst WARNING: If /mnt/LOGS/combine.tar already exists, you must use "tar -uvf" ... |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
The -uvf works!!
Thank you so much... |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Complex find and replace only 1st instance string with dynamic combination | SilvesterJ | Shell Programming and Scripting | 5 | 10-01-2011 07:08 AM |
| help with awk for file combination | yanglei_fage | Shell Programming and Scripting | 9 | 04-26-2011 01:42 PM |
| combination between || and && in IF condition with ksh | islam.said | Shell Programming and Scripting | 2 | 02-15-2010 08:09 AM |
| Grep and find combination | nervous | UNIX for Dummies Questions & Answers | 5 | 10-08-2008 05:21 AM |
| Combination of find -xargs & wc -l | mr_bold | UNIX for Dummies Questions & Answers | 4 | 07-08-2008 05:07 AM |
|
|