The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
combination of two commands nehaquick UNIX for Dummies Questions & Answers 3 02-01-2008 01:09 AM
Detecting a key combination mobile01 High Level Programming 11 12-22-2006 06:46 AM
awk and file combination sickboy UNIX for Dummies Questions & Answers 1 06-13-2005 06:02 PM
Getting 'tar' to exclude kuultak UNIX for Dummies Questions & Answers 6 02-07-2005 04:31 PM
Combination Of commands rahulrathod UNIX for Dummies Questions & Answers 2 12-14-2004 04:32 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-06-2008
Registered User
 

Join Date: Mar 2007
Location: Manila
Posts: 25
'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.
Reply With Quote
Forum Sponsor
  #2  
Old 02-06-2008
Registered User
 

Join Date: Nov 2007
Location: Belgium & France
Posts: 70
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" ...
Reply With Quote
  #3  
Old 02-06-2008
Registered User
 

Join Date: Mar 2007
Location: Manila
Posts: 25
The -uvf works!!

Thank you so much...
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:28 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0