Sync but keep certain files

rclone sync local gd:remote
I know "sync" is designed to make and source and remote as the same.
Is there a way to keep some files(based on filename or filetypes) not be deleted in remote?

If you don't want files deleted in the remote then you should use rclone copy instead of rclone sync.

Can you describe your use case a bit more and we can see if we can help you achieve what you want.

Ok.
It is a music library folder. It contains some music files(flac+cue+jpg) and DVDISOs and even BDISOs.
I regularlly make a update on the collection (adding and doing some format conversion) and make some structure tweak at local. The foldername tweak prevents me from using rclone copy.
I seldom uses those ISO files so I deleted them to save space at local.
I use rclone sync to backup(updated) it to Gdrive. (I do not need the reversions and old files)
I know if I use rclone sync later, the ISOs will go away.
But I need the ISOs remains(keep the strucure). I won't make foldername tweak to folders containing ISOs.
I have considered to use --backup-dir but it backups too many changes.

Let's say all the files you want to keep are *.iso.

Putting --exclude "*.iso" would stop these being synced and also stop them being deleted at the other end.

If you want the isos copied too, then you'll have to run another rclone copy --include "*.iso" in addition to the rclone sync --exclude "*.iso"

I think that should work. Test first with --dry-run!

Thanks. I will try that with --dry-run
I was thinking the filters only applied to source.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.