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.
V3l0
February 6, 2008, 4:17am
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 :
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" ...