Skip to content
Snippets Groups Projects
Commit 94493cee authored by Jonas Leder's avatar Jonas Leder
Browse files

Add new file

parent 2c67ddab
Branches master
No related tags found
No related merge requests found
#!/bin/bash
# Please mount the disk to the give path below before executing
mountPath="/mnt/backup"
if [[ ! $(findmnt -M "$mountPath") ]]; then
echo "Disk not mounted, can't continue"
exit
fi
echo "Disk mounted, creating storage in proxmox"
pvesm add dir usb-disk-backup --path "$mountPath" --content backup
echo "Storage in proxmoy created, running backups"
for CT in $(pct list | grep -v VMID | awk '{print $1}'); do
vzdump $CT --compress zstd --remove 0 --storage usb-disk-backup --mode snapshot
done
for CT in $(qm list | grep -v VMID | awk '{print $1}'); do
vzdump $CT --compress zstd --remove 0 --storage usb-disk-backup --mode snapshot
done
echo "Backups complete, removing storage"
pvesm remove usb-disk-backup
echo "Done, exiting"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment