Rsync copying within recent date range?

As many will point out, one of the benefits of using rsync (without --delete) is that it will sync files between source and destination, but not delete files in the destination which HAVE been deleted in the source. Well, I have kind of the opposite problem and I'm wondering if there are date parameters or something I can use with rysnc.

I tend to move files from my destination directory to other locations on the disk, but when I run rsync again, the folders that I have moved are "re-copied" to the destination (because I have moved them, duh).

Is there a way to use rsync to only copy files that have been created that day? Or better yet, only copy files that have been created since the last rsync operation?

I am just beginning to learn about unix commands, so it may well be that rsync is not the right tool for me anyhow. Thanks for looking, and thanks for any advice!

You could try this:

$ cd source
$ find . -newer last_run -type f -print0 | rsync -0a --files-from=- ./ DestHost:/path/to/dest/location
$ touch last_run
1 Like

Hey thanks for the script it really helps.

Can you explain what the following line means?

"--files-from=-"

Thanks again!