Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Permanent delete in OneDrive/Sharepoint #7812

Open
jcastilloalonso opened this issue Apr 30, 2024 · 5 comments
Open

Support Permanent delete in OneDrive/Sharepoint #7812

jcastilloalonso opened this issue Apr 30, 2024 · 5 comments

Comments

@jcastilloalonso
Copy link

jcastilloalonso commented Apr 30, 2024

The associated forum post URL from https://forum.rclone.org

https://forum.rclone.org/t/support-permanent-delete-in-onedrive-sharepoint/45944

What is your current rclone version (output from rclone version)?

1.66

What problem are you are trying to solve?

OneDrive for Business does count deleted items vs the account quota. After migrating my offsite backup to OneDrive, I now have to manually login to the account and empty the recycle bin from time to time, as uploading a replacement new backup revision will result in the old file being moved to recycle bin as rclone will delete the file before uploading the new one. This behavior is consistent even when no_versions is set to true.

How do you think rclone should be changed to solve that?

Adding a new flag similar to no_versions where we use this API instead of the regular delete item:
https://learn.microsoft.com/en-us/graph/api/driveitem-permanentdelete?view=graph-rest-1.0

After this, we just need to update the documentation to recommend the flag if there's no need to send to recycle bin.

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.
@edc-w
Copy link

edc-w commented May 13, 2024

Hello, if you are in need of this feature being added on behalf of your business and are interested in supporting the project whilst doing so, please get in touch at sales@rclone.com.

@ncw
Copy link
Member

ncw commented May 14, 2024

I implemented --onedrive-hard-delete here (named for consistency with the other backends). You can set this in the config file with hard_delete = true.

Note that this only works with onedrive business / sharepoint and does not work with onedrive personal - it gives API not found if you try it there.

v1.67.0-beta.7957.2d125976e.fix-7812-onedrive-hard-delete on branch fix-7812-onedrive-hard-delete (uploaded in 15-30 mins)

Please give it a test - thank you.

@ncw ncw modified the milestones: Help Wanted, v1.67 May 14, 2024
@gomaaz
Copy link

gomaaz commented May 14, 2024

Thx Nick,

I'll give it a try and let you know.

@gomaaz
Copy link

gomaaz commented May 14, 2024

It seems to work!

After deleting a few big-sized folders,
rclone about: is showing no bytes in "trashed"

Also the sharepoint-Website doesn't show any files in the trash-can!

I'm happy with that :)

Good work, Nick!

image

@jcastilloalonso
Copy link
Author

This is working great! Tested it with both delete and purge commands and both didn't land in recycle bin. Thanks a lot Nick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants