Intro#
I have the following simple backup setup for my Proxmox server. Since backup schedule is weekly, it would make a lot of sense to bring the backup server up only when it’s needed. I decided to make my own script after seeing one on 1 Proxmox forum.

Setup#
Here are the steps
- configure the PBS server’s BIOS so Wake-on-lan feature is enabled
- install
wakeonlanprogram on the Proxmox server if it’s not already installed
apt install wakeonlanbash- set up password-less login from Proxmox server
ssh-keygen -t ed25519
ssh-copy-id root@$PBSbash- create /usr/local/bin/vzdump-hook-script as follow and make it executable
#!/bin/bash
IP=<LAN_IP_OF_PBS>
MAC=<MAC_ADDRESS_OF_PBS>
# wait for at least $COUNT pings
COUNT=80
# check if wakeonlan is installed
which -s wakeonlan
if [ $? -ne 0 ]; then
echo "Please install wakeonlan first"
exit 1
fi
if [ "$1" == "job-init" ]; then
if ! ping -c 1 -W 1 "$IP" >/dev/null 2>&1; then
/usr/bin/wakeonlan $MAC #(mac Address of PBS Server)
ping $IP -c $COUNT
fi
fi
if [ "$1" == "job-end" ]; then
ssh root@$IP "/usr/sbin/poweroff < /dev/null &"
fi
exit 0bash- update /etc/pve/jobs.cfg to add this line
/etc/pve/jobs.cfg
script /usr/local/bin/vzdump-hook-scriptlog