Unix/Linux Go Back    



Hpux find tar gzip

HP-UX




Kindly Note - This is a Single User Post by Forum Member MadeInGermany Regarding:
Hpux find tar gzip.
Please Follow The Primary Link Above to View the Full Discussion.

   
Old Unix and Linux 08-05-2016
MadeInGermany MadeInGermany is offline Forum Staff  
Moderator
 
Join Date: May 2012
Last Activity: 18 October 2017, 2:55 AM EDT
Location: Simplicity
Posts: 3,778
Thanks: 311
Thanked 1,265 Times in 1,144 Posts

Code:
find * -type f -mtime -$nb_days -print | xargs tar cf - | gzip > $MAITUT/BCK_DATA.tar.gz

Maybe the following works as well (and handles special characters in filenames better)

Code:
find * -type f -mtime -$nb_days -exec tar cf - {} + | gzip > $MAITUT/BCK_DATA.tar.gz

Both methods will fail if there are too many files: a second tar is invoked that certainly obscures the tar file.
The Following User Says Thank You to MadeInGermany For This Useful Post:
royinfo.alain (08-08-2016)