-
Notifications
You must be signed in to change notification settings - Fork 123
Description
I like to have a hook to insert a script which runs before a notification email is sent.
Motivation: I like to see the total space occupied by all restic snapshots on the target server. I need this, because my target server has a quota, and I like to make sure I do not exceed the quota with the backup snapshots. As a hack-y workaround I modified /bin/backup and inserted four lines before the notifications are generated when I do rclone backups via sftp:
logLast " "
logLast " "
logLast "Total size occupied by all restic snapshots:"
ssh -i /volume1/docker/privatekey.pem [email protected] 'du -h restic/ | tail -1' >> ${lastLogfile} 2>&1
This is for my web space at Domain Factory's ManagedHosting 64 Medium which contains ssh access. It has a 50 GB quota. The snapshots are in the sub-folder "restic/". The generated text in the email I get ends with:
Total size occupied by all restic snapshots:
8.4G restic/
Of course, it would be much nicer and more sustainable to have this built in.
And maybe there is a much more elegant way to find out if I get close to exceeding the available space on the target medium?