Hi,
I am trying to figure out how to rclone sync to Google Drive without overwriting the destination-only files.
Of course, there would be a possibility to run rclone copy, however, I want the all of the source files to be changed/re-ordered/updated in the destination.
By destination-only files I mean such that are added to the "synced" folder from the GD side (e.g. if I create a Gdoc in the browser in the synced folder). This implies, it is not very convenient to extend a list of "excluded" in my sync command everytime I add something from the GD side.
hello and welcome to the forum,
not sure exactly what you want.
perhaps this flag will help
https://rclone.org/docs/#ignore-existing
"Using this option will make rclone unconditionally skip all files that exist on the destination, no matter the content of these files."
Hey and thanks. However, this is not an answer to my question. I need an option for ignoring only such files that are originated at the destination but not at the source. The thing is, I don't want the GDoc files at the destination to be overwritten, while I need to continuously update the files from the source.
--update Skip files that are newer on the destination.
If a file is newer at the destination it'll be ignored. I think this if what you're asking for.
EDIT: this would still delete files on the dest that aren't on the source. You need to use copy if you don't want that. Fundamentally how would rclone know if a file was deleted on the source versus created only on the destination....
Hey, thanks for the reply. This would rewind me back to the beginning. rclone copy is certainly something I do not want to use as this does not observe changes of file deletions and so on on the source and only clutters up remote.
This sounds ignorant, but if this works, I would like to do it the exact opposite way, thus want to keep LOCAL folder with the CLOUD folder in sync but preserve CLOUD-only files.
The docs page about rclone union is quite insufficient for me to understand union. Could you be please more elaborate in your explanation?
Thanks a lot!
So in your use case, files are added to the local folder and you want to add it to cloud remote? But don't want to erase the files you want cloud only?
This should work. Rclone will see that the disk folder is out of sync with the remote folder, but will also see that the cloud files already exists on destination to, so it will just check them and do nothing.
Obs: Don't forget to use --dry-run and change the folder and remote names to your setup. Let me know if it happens
@ncw I just found out some strange behavior with sync. A file in the remote cloud folder was renamed, but it still not syncing it to the local folder.
I tried with --track-renames, -c but it still thinks no change happened? After this file has been renamed to another name, I uploaded another file with the old name...do you think it could be this?
I found the issue. The default policy for the union, makes it so that the first remote is read first before the others.
I had my local folder set up first, so it was comparing the files locally. Just putting the remote folder first, makes it behave as expected with the default policy.