Closed mrcsrplln closed 1 month ago
I had a similar problem using a hook with Backrest running in a Docker container. The main issue was that even if you make the script available on a volume, the entire script runs inside the container. Therefore, you need to make all the resources required by the script available inside the container as well.
Since there were no dependencies between the two, I decided to use cron to schedule the operation a few minutes before the Backrest job.
I had a similar problem using a hook with Backrest running in a Docker container. The main issue was that even if you make the script available on a volume, the entire script runs inside the container. Therefore, you need to make all the resources required by the script available inside the container as well.
Since there were no dependencies between the two, I decided to use cron to schedule the operation a few minutes before the Backrest job.
Thanks. Yes that is a possible solution to be informed when a backup operation starts. But how do you tell if a backup actually completed or if it failed with an error?
But how do you tell if a backup actually completed or if it failed with an error?
Well... I'd probably use a Backrest hook :-) Just kiddin...
A long time ago I would have used an rpc call, but today I find it easier and more straightforward to use a webhook. You can install the server easily from here: https://github.com/adnanh/webhook
Then you just need to configure the hook on the host server to launch your script, passing it all the necessary parameters. You can also put a reverse proxy in front of it and discover that many interesting things can be done with webhooks!
But how do you tell if a backup actually completed or if it failed with an error?
Well... I'd probably use a Backrest hook :-) Just kiddin...
A long time ago I would have used an rpc call, but today I find it easier and more straightforward to use a webhook. You can install the server easily from here: https://github.com/adnanh/webhook
Then you just need to configure the hook on the host server to launch your script, passing it all the necessary parameters. You can also put a reverse proxy in front of it and discover that many interesting things can be done with webhooks!
Thanks for the hint!! Will surely give it a go!
Great, if you need any hint just send me a msg here, I'll be happy to help! Ciao.
Thanks @stefanomarty for the ideas -- using backrest w/webhook is an interesting setup, aiming to take a look at the project in the evening.
Just dropping in to add that you can use patterns like https://garethgeorge.github.io/backrest/cookbooks/command-hook-examples#notify-a-healthcheck-service to include properties from the hook in the webhook calls you issue using curl .
Fwiw if you're trying to configure telegram you might look at Backrest's shoutrrr integration which offers telegram support https://containrrr.dev/shoutrrr/v0.8/services/telegram/
As suggested by @stefanomarty , to solve the issue I used webhooks. So, basically:
Thanks again @stefanomarty for the support, I hadn't worked with webhooks before, this opens a lot of opportunities. Also thanks again to @garethgeorge for the amazing work with backrest.
Hi, firstly thank you for your effort with Backrest, I am really finding it extremely useful. I am having an "issue", probably due to my still limited knowledge of Linux.
Basic Info
What is the "issue"?
What have I tried so far?
bash /path/to/script.sh
#!/bin/bash apprise -vv -t 'Restic Backup - Error!' tgram://...my_telegram_identification
If I run the script directly from shell in Debian it works fine and I get my telegram notification.
Any suggestions would be greatly appreciated.