I have a set of files in storage, and I would like to get only the new files and put it in another directory. Is there a way to do this?
For example:
The "old files" are contained in:
folder/oldfiles
I would like the new files coming in from rsync to be put in folder/ [and my script would put it in oldfiles, after the file has been processed]
Is there anyway to do this with rsync?
Best Answer
rsync --ignore-existing --dry-run --verbose SOURCE PROCESSED > OUTPUTFILE
OUTPUTFILE
to make sure it only contains file namesrsync --files-from=OUTPUTFILE SOURCE PROCESSING
Of course, you will want to add your usual options to the first rsync comand, e.g.
--archive
or--recursive
.