Restore -delete flag is not deleting files

Hello, I’m running a test restore and am having difficulty with the -delete flag through the Web-UI. I am not running any other flags other than -delete, and have chosen the root directory. It is restoring to the same repository that the backup was made from, so I am not restoring to an alternate location.

I placed a test screenshot png file into one of the subdirectories, and would expect it to be deleted since it is not in the snapshot, and yet, it is not deleted. However, the logs have this, and seem to indicate that “2021-10-04 11:33:15.008 INFO RESTORE_DELETE Deleted Music Library/folder_1/Screen Shot 2021-10-03 at 10.54.38 AM.png” has been deleted. Any ideas?

Excerpt from the logs are below. Thank you!

2021-10-04 11:33:13.190 INFO RESTORE_START Restoring /Volumes/music to revision 1
2021-10-04 11:33:15.000 INFO DOWNLOAD_PROGRESS Downloaded chunk 1 size 2965876, 1.41MB/s 00:00:01 100.0%
2021-10-04 11:33:15.008 INFO RESTORE_DELETE Deleted Music Library/folder_1/Screen Shot 2021-10-03 at 10.54.38 AM.png
2021-10-04 11:33:15.009 INFO RESTORE_DELETE Deleted Music Library/folder_1/.smbdeleteAAA12b
2021-10-04 11:33:15.010 INFO RESTORE_DELETE Deleted Music Library/folder_1/.smbdeleteAAA129
2021-10-04 11:33:15.028 INFO DOWNLOAD_DONE Downloaded .DS_Store (10244)
2021-10-04 11:33:15.028 INFO RESTORE_END Restored /Volumes/music to revision 1
2021-10-04 11:33:15.028 INFO RESTORE_STATS Files: 1 total, 10K bytes

Please see Restore -delete option silently ignored.

I tried a restore -delete to a root directory recently, and thought that -delete was still ignored. I suspect it may always be ignored by the Web UI since it may always specify a pattern.

Thanks very much! I did see your past thread. My takeaway was that if it was pointing to the root directory, with no filters or patterns, it would work – but it’s an interesting notion that perhaps the Web-UI interferes with this. I suppose I could try the CLI but I’d be curious to know if anyone else using the Web-UI has been able to -delete successfully. And I’m also just surprised that this isn’t a more common issue. I feel like deleting is very much so an important part of restoring to a previous snapshot state.

The RESTORE_DELETE log messages mean the -delete option was correctly specified in the web GUI. It seems to be a bug here:

The return code is ignored so Duplicacy doesn’t complain if the file can’t be deleted for any reason. Most like this is permission issue preventing that file from being deleted by the user account that runs the web GUI.

1 Like

Thanks @gchen! I checked the logs from my NAS and strangely, I did not see evidence of any denied attempt to delete the PNG file, as would be the case in a permissions error. The other files were modified successfully and it was all done using an account with admin privileges. Oddly enough, I re-tried earlier today and it seems to work as intended now, with the file deleting as it should. I’m doing a couple other tests to confirm. Because I can’t pinpoint the reason why it did not work yesterday, I’m doubting its reliability a bit, but will continue to test. Appreciate the insight into the potential bug.