-
Notifications
You must be signed in to change notification settings - Fork 70
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
Per source hooks in the config file #902
Comments
Thanks a lot @rehanone for your feature request! I think this is quite a small enhancement which would only affect the rustic CLI and not rustic_core. There are already several command which are called, see e.g. this config file - and the called hooks could just add to this list. |
@aawsome , thanks for a very quick response. Yes I agree that is a very small change in the CLI only. It is already implemented on the repository level in |
@aawsome, I would also like to suggest that making each of these hooks to be a list of commands rather than a single command would be much better in terms of making it flexible. This would not be a big change in the design but allows for adding arbitrary number of commands to be executed against each hook. |
+1. I am using restic+resticprofile wrapper and now trying to move to rustic. run-finally:
- 'grep -Ev "(^unchanged\\s|\(0 B added, 0 B stored\))" {{$logName}} > "…/logs/bkp-$PROFILE_NAME/$(date '+%Y-%m-%d_%H-%M-%S').log"'`
- # notify command here To filter and organize logs and notify if something important happened. Note: Note 2: resticprofile runs each command in a list separately, so run-after:
- 'my_var=123'
- 'echo $my_var' outputs nothing. It may create some inconveniences, but seems more secure. For reference: resticprofile hooks |
Hello I would also be very interested in for that feature. I also suggested hooks for other actions in autorestic (cupcakearmy/autorestic#213) such as backup restore or checking for example. |
We have a WIP-PR for this: #1218 |
This PR adds `run-before`, `run-after`, `run-failure` and `run-finally` hooks for: - all commands in the `[global.hooks]` config profile section - commands accessing the repository in the `[repository.hooks]` config profile section - the `backup` command specifically in the `[backup.hooks]` config profile section - specific backup sources in the `[backup.snapshots.hooks]` section Note: This PR includes only calling the given commands. If there is the wish for supplying information to the commands (env variables or parameter substitution), this should be covered by a separate feature request/PR. closes #902 --------- Signed-off-by: simonsan <[email protected]> Co-authored-by: simonsan <[email protected]>
Thanks a lot for creating wonderful alternative to the amazing
restic
program. I have been watching the progress of your project for a while and waiting for the right moment to jump on. We a few things have happened that cause me to seriously take a look at this project. I have been looking to restore a very old snapshot in restic and found the lack of any description very challenging in figuring out the right snapshot to pick. So the fact that this one has that ability is great incentive going forward. However I am using a wrapper for restic called autorestic which has the ability to call scripts/programs per source/location as hooks. I use this ability extensively to gracefully bring down containers before backup and bring them back up after the backup is complete. There is a documentation available for this feature here. There are 4 hooks supported:These hooks are per source. But I think there might be some value in having hooks that are called per repo as well.
The text was updated successfully, but these errors were encountered: