Can a backup hook script exit from the backup?

Feb 14, 2021
41
2
13
68
Denmark
Each night I make a backup from Proxmox to an external HD. With a backup hook script I can check if the external HD is mounted, before the backup job is run. But can I also, in the hook script, prevent the upcoming backup if the HD is not mounted?

Jesper, Denmark
 
hi,

With a backup hook script I can check if the external HD is mounted, before the backup job is run. But can I also, in the hook script, prevent the upcoming backup if the HD is not mounted?
probably you can add a condition in your script to do an early abort.

you can show us your script if you need help
 
you could try something like this:
Code:
#!/usr/bin/env bash
grep -qs /mnt/backupdisk /proc/mounts
if [ $? -ne 0 ]; then
    # skip backup
    echo "skipping because mountpoint doesn't exist...";
    exit;
else
    # continue
    echo "everything normal";
fi
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!