Rclone sync with compare

What is the problem you are having with rclone?

It is not a problem, but more of a question... I am am using rclone sync to synchronise a cloud folder in pCloud to a local folder on the pi. Everything is working perfectly. The only challenge I am facing is that the local folder on the pi is a playlist folder for a looping video player. When I run rclone sync and the remote/local folders start syncing, the video player sees changers in the local folder and starts trying to play the video files (which are not finished downloading yet). I can solve this by using a staging folder on the pi, so that when the sync runs it downloads temporary to /local_folder/videos-temp and then when the download is complete, a simple bash script can move the folders into the final location. This would solve the problem, but it introduces another problem. rclone sync compares folder contents so the temporary staging folder would need to needs to retain a full duplicate set of files as the main /videos/ folder that the video player reads from. If it does not, rclone sync will download the whole cloud folder every time. So my question is, can I use rclone sync to compare remote folder A with local folder A but when actually syncing the files, place any new files in local folder B.

What is your rclone version (output from rclone version)

rclone v1.54.0
  • os/arch: linux/arm
  • go version: go1.15.7

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Raspberry Pi

Which cloud storage system are you using? (eg Google Drive)

pCloud

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone sync -P pcloud:/KBC\ Media\ Player /home/pi/videos

Paste command here

The rclone config contents with secrets removed.

Paste config here

A log from the command with the -vv flag

Paste  log here

Not that I'm aware of as you sync from source to destination.

Perhaps some hard links and scripting might be a thing?

You could do this with the --compare-dest flag so something like this

rclone sync -i -P pcloud:/KBC\ Media\ Player --compare-dest /home/pi/videos /home/pi/videos-temp

Then you can move everything into place with something like

rclone move -i /home/pi/videos-temp /home/pi/videos 

Remove -i when happy!

This is exactly what I was looking for, thank you Nick!

Much appreciated.

Thanks for the reply. Nick has a good solution below.

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