Unable to delete other files when there are locked files that need to be backed up

During backup, as long as there are files that need to be backed up but are locked at the same time, you cannot delete the files that need to be cleared.

  1. Directory file description (now C:\SOURCE and C:\DESTINATION are exactly the same)
C:\SOURCE C:\DESTINATION
aaa.docx = aaa.docx
bbb.xls = bbb.xls
lock.txt = lock.txt
  1. Modify files under SOURCE

2.1 Modify the contents of C:\SOURCE\lock.txt file

2.2 Modify the file name of C:\SOURCE\bbb.xls to ccc.xls

2.3 Exclusive lock open C:\SOURCE\lock.txt

C:\SOURCE C:\DESTINATION
aaa.docx = aaa.docx
bbb.xls
ccc.xls
lock.txt (modified) != lock.txt
  1. Backup again

rclone sync --create-empty-src-dirs --delete-excluded "C:\SOURCE" "C:\DESTINATION" -vv

C:\SOURCE C:\DESTINATION
aaa.docx = aaa.docx
bbb.xls (Not deleted)
ccc.xls = ccc.xls (Copied New)
lock.txt (modified) != lock.txt

This is by design - as per docs:

Note that files in the destination won't be deleted if there were any errors at any point.

In general it is not good idea to try to operate on opened/locked files. Does not matter if rclone or any other software. End result might be unpredictable.

I would strongly advice to use filesystem snapshots (VSS on Windows) in such situations. For backups IMO it is a must approach.

Here you are good summary written by @asdffdsa how to use it:

Thank you, I will try to determine whether the corresponding process is running to modify the exclusion list or VSS, thank you again

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