Only sync files that are x Days newer than remote?

Im trying to sync a folder to onedrive, however it contains a few files that are frequently changed. I dont want to constantly sync these changes. Is it possible to only sync file changes when the modification time is > 1 day difference between the local copy and the remote synced copy?

Sure, use --min-age 1d to only sync files with a modification time of > 1 day.

I was led to believe that it would also delete files that werent older than one day off the remote if using sync

It shouldn't do unless you use --delete-excluded

Use rclone copy if you don't want stuff deleted is the best strategy though.

The general rule that applies when you use filtering with sync is that all files that fall outside the filter are completely ignored on both sides. (ie. filtering applies on both ends).

So that means that sync won't delete any files that didn't fit inside the filtering either. rclone simply won't evaluate them at all and leaves them alone.

--dry-run is a good flag to run any time you aren't quite sure about a command. It will simulate what happens but not actually perform any actions so you can take a look and see that the result looks reasonable. It is always wise to be careful about using sync until you understand it fully since "wrong" commands have the potential of deleting something you didn't intend to delete (although you would always be able to recover it from the Gdrive trashbin with some effort in an emergency).

Ah I see, thanks for the tips! This helped me to determine that copy is exactly what I want, not sync. Also --dry-run was super helpful :slight_smile:

1 Like