Unix/Linux Go Back    

Hpux find tar gzip


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   -   Original Discussion by royinfo.alain
MadeInGermany's Unix or Linux Image
MadeInGermany MadeInGermany is offline Forum Staff  
Join Date: May 2012
Last Activity: 18 March 2018, 4:53 PM EDT
Location: Simplicity
Posts: 4,008
Thanks: 343
Thanked 1,346 Times in 1,214 Posts

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)

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)