Anyone have really solid battle tested backup scripts for restic?
Right now I have a script for local and remote backup as well as a maintnance script to prune while using --keep-within as well as a check script for --read-data-subset==1G.
This all works well, as far as I can tell so far.
A few things I want to solve that I do not have done.
Fail script if it is still running. This means, if my remote backup is still running, and a cron job kicks off a new one, it doesn’t have issues. I know Restic has it’s own locking, but from my quick testing, it will still try to do more than one, and won’t error gracefully. This also needs to be limited to the specific backup, like the local won’t fail if the remote is still going.
Notification of errors. Right now I am just manually kicking off the local and remote scripts every so often, so I can baby sit it while I get used to restic as well as moving stuff from my old machine to this machine and start migrating from Backblaze’s personal backup system to B2. I don’t want an email if everything goes fine, but if there is a problem, I would like to be notified. This includes some form of notification if the backup hasn’t been done in 24 hours.
Backup validation checking, right now I use the check data random 1G segment feature, but I am not sure how reliable that really is. I know some people download specific files then compare it to their current filesystem as well.
Only addressing the notification part: you can use healthchecks.io. You notify it of success or failure by making a request to a URL they give you, and it will email you if you either don’t ping it in a while (by default 24h + 1h grace period, but configurable) or ping it with a failure.
Personally, I just use cronic and run restic with -v. If it runs with no errors, I get zero output (cron doesn’t email me). If it errors, I get a very detailed output from cron as to what went wrong.
For monitoring the actual repos to ensure they’ve being modified/updated I use Zabbix, which would be way overkill for your situation.
I would really suggest you look at resticprofile, it’s great.
There is also NPBackup, which is basically a big CLI / GUI wrapper for restic, which handles most scenarios, adds rotating logs, supervision support, restic_password encryption, permissions…
My current implementation runs on about 100 various workloads (windows, linux, kvm backups, synology NAS…).
Okay, I’m sorry if this is out of subject, but why cronic specifically ?
My project for instance uses restic x64 (to support various windows only functions like VSS) and schedules it’s run via task manager.
Isn’t the windows task manager good enough ?
Currently I also use only Windows and I launch the backups with the Task Scheduler
I was just curious to know how to implement those reports as I am working on Windows scripts to do automatic checks of various backups and wanted to get a general overview.
Personally, I just use cronic and run restic with -v. If it runs with no errors, I get zero output (cron doesn’t email me). If it errors, I get a very detailed output from cron as to what went wrong.
@fede That’s exactly the job my project does.
Launch backups, housekeeping (eg check + forget + prune) and report all that to prometheus or a local file
On top, my solution has an orchestrator, where you define group settings (retention policies, upload speeds…) and then launch group operations on all repos from group.
Perhaps you could have a look ? (Sorry if I’m doing some advertisement, but I’m desperate to get some feedback before going RTM).
I’m not searching contributions (even if they’re welcome), but more feedback.
I’m releasing a RC5 today (with restic 0.17.1 baked in).
Perhaps you could just give the viewer a try, and perhaps tell me if the GUI makes sense to you ^^
If the project happens to please to you, I could (quickly) bake in mail alert support so perhaps you could use that project which is quite battle tested now.