Closed Chippit closed 3 months ago
I second this as I just wanted to report it as a bug (which it is, IMO). My use-case is that I do btrfs snapshot
in before
hook. Autorestic fails unless I do the first snapshot manually before the first backup, and I cannot delete the snapshot in after
, otherwise it throws an error on next run.
It is not a big deal in my case, althought it took me about half an hour to realize where the problem lies, and it is a bit inconsistent with expectations of when before
is executed.
I'll have a crack at creating a PR for this.
My use case is to use a hook to mount the backup source location that contains the "from" directory -- that directory doesn't exist until that mount completes, and the "before" hook runs after checking that all the "from" directories in the location exist, hence that hook is too late.
Currently, if you have a location with a given file path that doesn't exist at the time of executing autorestic, backups will fail, even when the file will exist after before hooks are run.
In this situation, before and after hooks do not run at all.
While it's feasible to create an empty version of this file in advance of executing autorestic, it does require the sort of manual intervention and custom scripting that autorestic otherwise resolves.