Protecting OneDrive files from credential loss

What is the problem you are having with rclone?

I’m not sure if OneDrive files are protected from being edited remotely if credentials are lost. I have a password database in my OneDrive and I don’t want it to be editable if someone gets my credentials from the server I’m backing up from to my OneDrive. I can’t use config encryption because the backup script needs to run automatically, so the credentials are not that safe. I want there to be only the option of deleting the password database, so that it goes into the Trash where I can restore it from when logging in online. rclone sync says ‘Duplicate objects (files with the same name, on those providers that support it) are not yet handled’. That is a good thing and I think this behaviour should never be changed. I hope there are no plans for this? But rclone copy says ‘Doesn't delete files from the destination’. This is an ambiguous piece of text and should me made clearer. Does rclone copy update a file when copying it to a file with the same name (instead of deleting and replacing it)? Or does this only mean it won’t delete files in the destination that are not in the source folder? It should delete and replace files with the same name instead of editing them, because edited files are not backed up to the online Trash. Please update the documentation to make this clear. Thank you for your time!

if you lose the rclone config file, then rclone cannot access the files.
you would have to re-create the rclone config file again.


run the script as root, or use systemd.
in that case, standard user cannot see the rclone config password.


  1. rclone deletes the dest file.
  2. rclone copy the file from source to dest.

fwiw, perhaps, do some simple testing on your end.
the answer to your questions should be in the rclone debug log.

then you are welcome to propose changes to the rclone docs.

Thank you for your answer! Good thing that rclone deletes a file before uploading an updated/changed file. But when I view the permissions the rclone token has in my Microsoft account, it clearly states files can be edited. I understand rclone does not update/edit files directly, but is it not possible for a different (custom) script/application to edit the files directly using the token? I don’t want my files to be editable directly (bypassing the Trash) by any program in case I lose the token. So, would editing files directly be possible with another program if I lose the token? Maybe the permissions of rclone could be stripped down to only allow deleting and adding files, not ‘editing’? Thanks again for your time!

i believe that applies to editing files via microsoft website.
rclone does not edit the contents of files.


yes. but tokens expire, often after one hour. if a token expires, rclone will request a new token.
a rclone debug log would show you that...


without the token rclone cannot access onedrive.

how would you expect another program to edit files in ondrive without a token and/or username+password?


as already discussed, rclone does not edit files, rclone works on complete files, with copy|move|delete|etc...