backrest icon indicating copy to clipboard operation
backrest copied to clipboard

Add hook suitable for mounting/unmounting drives

Open eknoes opened this issue 2 months ago • 3 comments

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:

error: forget: get snapshots for repo ExternalHDD: command "/home/XXX/.local/share/backrest/restic-0.16.4 forget --json --keep-hourly 24 --keep-daily 7 --keep-weekly 4 --keep-monthly 3 -o sftp.args=-oBatchMode=yes --tag plan:SystemBackup --group-by tag" failed: exit status 1
Process STDOUT: 
Fatal: unable to open config file: stat /mnt/backup/config: no such file or directory

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.

eknoes avatar Apr 17 '24 09:04 eknoes