1834513 Members
2287 Online
110068 Solutions
New Discussion

Re: archiving

 
SOLVED
Go to solution
Amir Fadaghi
Advisor

archiving

Has anybody used find with xargs and tar to archive find that have been modified within last 7 days? I appreciate the help

thanks
reach and touch someone
3 REPLIES 3
Peggy Fong
Respected Contributor

Re: archiving

Hi

I've seen this done but I can't fully remember the command. I thought it was something like:

find /{path} -mtime +7|xargs tar -cvf archive -

This is assuming that I remember correctly that tar will take standard input (-)

Should be easy to test.

Good Luck.
Check man on find - there may be a tar command in the example section that you can use to do what you want with modification.

Peggy
Alan Riggs
Honored Contributor
Solution

Re: archiving

find {PATH} -type f -mtime -7 | xargs tar cvf {ARCHIVE}
Carlos Fernandez Riera
Honored Contributor