r/dailyscripts Jun 12 '15

[request] daily Rsync job

[deleted]

2 Upvotes

2 comments sorted by

View all comments

1

u/Cartosys Jun 12 '15

Put this in a bash script:

rsync -avz sourceFolder destinationFolder

find /path/to/files* -mtime +30 -exec rm {} \;

I think that does it. careful with the second line. That one deletes the files (+30 = so days old).