Is it possible to rewrite entire sub- directories and everything inside it?

Hello. First post here. Thanks for restic. I am planning to use it for my personal backups but I am stuck here. I would appreciate some help.

rewrite --exclude command seems to only work with single files. I want to rewrite an entire subdirectory.

For example: F:Stuff/Screenshots/Work

I want to delete everything inside the work folder and the work folder itself, if possible.

I tried

restic -r rclone:username:crypt --verbose rewrite --exclude F:Stuff/Screenshots/Work

and

restic -r rclone:username:crypt --verbose rewrite --exclude F:Stuff/Screenshots/Work/*

It did not work. I am on Windows 10.

Thanks.

Wait, I figured it out.

foo/**/bar

Where “foo” is the directory where the subdirectory “bar” is under.

https://restic.readthedocs.io/en/latest/040_backup.html#backup-excluding-files

That doc has it. I will leave it here in case someone comes looking for it too.

3 Likes