Workaround for OneDrive purge

Continuing the discussion from Purge command fails on OneDrive:

Have you given any additional thought to the workaround you mentioned for the Purge command on OneDrive? It doesn't look like the Go runtime is going to be fixed anytime soon.

I find myself needing the purge command on a OneDrive remote. For small directory trees with minimal files the --disable purge flag works fine. But on larger trees with more files, the command can take quite a while to complete.

I'm not desperate yet—but I'm getting closer.

that link you shared is years old,

according to the documentation, rclone supports purge for onedrive.
have you tried the purge command and it failed?

works for me

rclone lsd onedrivevb: 
          -1 2022-01-23 16:57:42         2 Attachments
          -1 2021-03-12 14:34:50         4 crypt01
          -1 2022-03-17 12:16:22         1 crypt02
          -1 2021-03-12 15:30:13         2 en07.keepass.zip+kdbx.zip-20200609_20210315
          -1 2021-03-12 17:29:09         1 termux
          -1 2021-10-29 13:30:27        14 thezorkdir
          -1 2022-01-11 10:01:29        79 veeam
          -1 2022-04-20 14:25:56         4 zork

rclone purge onedrivevb:zork -vv 
DEBUG : rclone: Version "v1.58.0" starting with parameters ["C:\\data\\rclone\\rclone.exe" "purge" "onedrivevb:zork" "-vv"]
DEBUG : Creating backend with remote "onedrivevb:zork"
DEBUG : Using config file from "C:\\data\\rclone\\rclone.conf"
DEBUG : 5 go routines active

rclone lsd onedrivevb: 
          -1 2022-01-23 16:57:42         2 Attachments
          -1 2021-03-12 14:34:50         4 crypt01
          -1 2022-03-17 12:16:22         1 crypt02
          -1 2021-03-12 15:30:13         2 en07.keepass.zip+kdbx.zip-20200609_20210315
          -1 2021-03-12 17:29:09         1 termux
          -1 2021-10-29 13:30:27        14 thezorkdir
          -1 2022-01-11 10:01:29        79 veeam

Are you on a OneDrive Personal or Business account? It works for me as well when I use a OneDrive Personal remote. But it fails on OneDrive Business.

rclone purge onedrive-business:purge_test -vv
2022/04/20 14:55:42 DEBUG : rclone: Version "v1.58.0" starting with parameters ["rclone" "purge" "onedrive-business:purge_test" "-vv"]
2022/04/20 14:55:42 DEBUG : Creating backend with remote "onedrive-business:purge_test"
2022/04/20 14:55:42 DEBUG : Using config file from "~/.config/rclone/rclone.conf"
2022/04/20 14:55:44 ERROR : Attempt 1/3 failed with 1 errors and: accessDenied: Request was cancelled by event received. If attempting to delete a non-empty folder, it's possible that it's on hold
2022/04/20 14:55:44 ERROR : Attempt 2/3 failed with 1 errors and: accessDenied: Request was cancelled by event received. If attempting to delete a non-empty folder, it's possible that it's on hold
2022/04/20 14:55:45 ERROR : Attempt 3/3 failed with 1 errors and: accessDenied: Request was cancelled by event received. If attempting to delete a non-empty folder, it's possible that it's on hold
2022/04/20 14:55:45 DEBUG : 5 go routines active
2022/04/20 14:55:45 Failed to purge: accessDenied: Request was cancelled by event received. If attempting to delete a non-empty folder, it's possible that it's on hold
[onedrivevb]
type = onedrive
client_id = xxx
client_secret = xxx
region = global
token = xxx
drive_id = xxx
drive_type = business

accessDenied: Request was cancelled by event received. If attempting to delete a non-empty folder, it's possible that it's on hold
that is a message from onedrive, rclone is simply printing it.

this does not seem to be a rclone issue, but a onedrive issue.
did you try to search the internet about it?
for example,
https://github.com/abraunegg/onedrive/issues/338

Yes, I'm looking into the possibility that it's due to retention policies now. Thanks.

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