-delete flag not working on restore

When I attempt to restore using the -delete option, it doesn’t delete anything. Files still remain which are not in the snapshot.

restore -threads 10 -stats -r 63 -delete -overwrite -- i:path/to/files/.*$

Are you running the restore command in the root directory of the repository, i.e. are you restoring the files to the exact same place from where they were backed up?

When you specify any file/pattern to restore, the -delete option has no effect. This is mainly to avoid deleting files unintentionally.

The guide to the restore command didn’t mention this – I just added it.

3 Likes