How to delete locked file

I want to force delete the locked file(which is open). But the --ignore-errors flag don't seemed to work.

rclone delete  --ignore-errors remote:/dir/Book.xlsx

A log from the command

2022/03/08 20:30:38 ERROR : Book.xlsx: Couldn't delete: notAllowed: resourceLocked: The resource you are attempting to access is locked
2022/03/08 20:30:38 ERROR : Attempt 1/3 failed with 3 errors and: failed to delete 1 files
2022/03/08 20:30:39 ERROR : Book.xlsx: Couldn't delete: notAllowed: resourceLocked: The resource you are attempting to access is locked
2022/03/08 20:30:39 ERROR : Attempt 2/3 failed with 3 errors and: failed to delete 1 files
2022/03/08 20:30:40 ERROR : Book.xlsx: Couldn't delete: notAllowed: resourceLocked: The resource you are attempting to access is locked
2022/03/08 20:30:40 ERROR : Attempt 3/3 failed with 3 errors and: failed to delete 1 files
2022/03/08 20:30:40 Failed to delete with 3 errors: last error was: failed to delete 1 files

hello and welcome to the forum,

rclone cannot delete an in-use, open, or locked file

same would apply to windows explorer and the del from command line.

on windows, a tool i have used is https://www.iobit.com/en/iobit-unlocker.php
but even then, such tools do not always work.

Thank you for the help. Forgot to mention that that the remote is onedrive.
Then what kind of errors covered with --ignore-errors?

imho, not a rclone issue.
rclone cannot delete a lock file.
onedrive has lock the file, not rclone.
rclone is printing out the response it got from onedrive.

i would make sure that the .xlsx file is not opened/in-use by something, such as the web interface of onedrive.

https://stackoverflow.com/questions/61554807/microsoft-update-driveitem-api-throwing-locked-exception-if-the-file-is-open-in

https://community.plumsail.com/t/teams-delivery-failed/11640

but at this point, when you posted, there was a template of questions, now is the time to post the answers to ALL of them.

I know for sure that it's open by some user. Probably will try to use onedrive api for it.

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