I would really appreciate some guidance on what's the best way to accomplish a task I've been having difficulty with.
I need to sync a local folder to a remote folder on Google Drive. I already have the Remote fully synced in the past, however a lot of things have changed on the Source folder since. Some large video files have been deleted from Source that I would like to ensure are preserved on the Destination after re-syncing, yet for all other files I would like Rclone to sync the Destination to look exactly like the source.
So essentially, I need a way to do full rclone sync operation that replicates the entire contents of Source to the Remote, including copying any new video files it finds in Source, but that does not delete any video files already present in the Destination even if they were removed from the Source. All other files should be deleted on the Destination if they no longer exist in Source as in a regular syncing operation. Video files are understood to be files ending with the extensions ".mp4", ".mkv" or ".webm".
What would be the best way to accomplish this task? Thank you very much for the assistance!
What is your rclone version (output from rclone version)
v1.57.0
Which cloud storage system are you using? (eg Google Drive)
Google Drive
The command you were trying to run (eg rclone copy /tmp remote:tmp)
Ideally something like rclone sync Source Remote: --exclude-from-deletion *.mp4
I need existing video files to not be deleted from the destination (i.e. they exist only in the destination), but if they only exist in the source I need them to still be copied to the destination. All other file types that are not video files should still sync as normal.
Sync makes destination identical to the source. You can filter the source to match only video files, but in your scenario you asking to not delete the destination if it doesn't match the source.
Do you want to copy source to destination and filter on video files?
For the second, you can just sync as normal and exclude the video file patterns as that sounds like it operates as normal. --dry-run and testing with rclone first would be very important.
I suppose the idea of doing it in two sets of operations, first a sync excluding video files, then a copy to just move the remaining video files might work. How would I go about excluding the video files from the sync operation? What kind of pattern should I use? The documentation for filter seems a little confusing to me. Thank you for the input so far!
The goal is to exclude all .mkv, .mp4 and .webm files from the Source folder and all subfolders so that they dont get synced then I guess. How would that look like as a filter?