-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hook suitable for mounting/unmounting drives #227
Comments
Interesting -- this is a bit of an oversight on my part. I had intended the backup start and stop hooks to work for this type of application but (obviously in retrospect) you need a hook that applies to every operation that does work on the repo if you're actually storing the repo on an external drive. Two ways I can see solving this
In either case, it's also true that backrest runs multiple tasks that are generally unaware of one another (and trigger their own hooks) in a backup flow. E.g. Do you have ideas how you might debounce the events (or apply a timeout?)? Or more broadly what UX you'd want to make the hooks most usable edit: thought about this a bit more today, I think the right way to handle this will be to introduce a |
That sounds good! I am not so familiar with how backrest works, but I guess some hook that always runs when opening / closing the repo would be the best! But I also think these operations are not that costly compared to the backup operation. So if its not so easy to ensure all operations run in between the hooks, it would be also fine if the hooks run multiple times (E.g. Mount -> Backup -> Unmount -> Mount -> Forget -> Unmount -> Mount -> Index -> Unmount). |
I would also be interested by such options. Overall, I think that having more options in the "hook" section would be very nice for many people. |
I can use |
This is something I still need to look at, part of my hesitancy to take action on this bug is that I'm concerned any solutions here won't be very robust. Running a mount and unmount command before / after each operation is likely to mount and unmount your drive rapidly in sequence as Backrest runs restic commands on your behalf. Something a bit more clever feels like it might be needed. |
I understand, maybe some option that allows running a post backup script? |
@hefistion i think the only way in the moment is to have a "watch script" on your mounted machine. then create with the Snapshot_end hook a temporary file. the watcher on the mounted machine see this file and start a countdown and after that countdown the machine goes shutdown. or have you found a better solution? |
Is your feature request related to a problem? Please describe.
I store my backup on a physical USB hard drive. Currently, it is permanently mounted, which keeps the HDD running for ~30 minutes, after going into some standby mode. I would like to unmount it right after the backup.
I tried using the snapshot start hook of the repository, but it seems like that one is already "too late", as my backup fails because the repository is not mounted.The mounting on snapshot start works, but after the backup (and unmount) "forget" has the following error:
Describe the solution you'd like
I'd like to have
pre-backup anda post-backup hook that is suitable for unmounting the hard drive.The text was updated successfully, but these errors were encountered: