v1.3.1 - 2020/01/21
A beta version for an unRAID plugin is located here and in Community Applications.
Script for use with unRAID's CA User Scripts plugin. See here for more information.
Currently the script is in a relatively stable state, and most of the features have been implemented. I have tested them as well as I can, but I cannot guarantee they will work correctly for everyone, so be sure to test thoroughly on your system before depending on this script for backups. Please review the Change Log and To-Do List if you would like to know more.
The virtual disks attached to a single VM must have unique names regardless of their location since during the backup they will be placed into the same folder. i.e. VM1 cannot have /mnt/diskX/vdisk1.img and /mnt/users/domains/VM1/vdisk1.img since the vdisks will overwrite the each other during the backup. However, VM1 and VM2 can both have a vdisk1.img since they will be backed up to different folders.
-
Add the script and description files to the CA User Scripts plugin. No other files are necessary to make the script work.
-
Set the variables in the script file.
-
be sure to set enabled = "1" to ensure that the script will run.
-
to enable the script while parity check is running change line 4 from "noParity=true" to "noParity=false"
-
-
Choose a schedule in the CA User Scripts plugin.
-
Choose a backup location.
-
Choose to backup all VMs, or list specific VMs to be backed up.
- If backup all VMs is enabled, the list of VMs to backup is used as an exclusion list instead.
-
List specific vdisks to skip, if any.
-
List specific vdisk extensions to skip, if any (iso listed by default).
-
Option to use snapshots to backup VMs without shutting down.
-
be sure to install the qemu guest agent on VMs to enable quiescence, which will improve the integrity of backups.
-
the disk path in the VM config cannot be /mnt/user, but instead must be /mnt/cache or /mnt/diskX.
-
-
Option to kill a VM that won't shutdown cleanly.
-
Option to have VMs start after backup based on their previous state.
-
Advanced: Option to have VMs start after successful backup regardless of previous state.
-
Advanced: Option to have VMs start after failed backup regardless of previous state.
-
Choose the number of days to keep backups.
-
Choose the number backups to keep.
-
Option to log to file.
-
Choose the number of log files to keep.
-
Option to create a VM specific log in each VM's sub-folder.
- Uses the same retention policy as the VM's backups.
-
Option to log messages through unRAID notification system.
-
Option to only receive error notifications
-
Option to receive detailed notifications.
-
sends notifications when VM backups are started and stopped.
-
sends notifications when old backups are deleted.
-
-
-
Option to compress backups.
-
legacy option for tar.gz files.
-
support for zstandard.
-
Option to set compression level.
-
Option to choose number of threads.
-
-
-
Option to timestamp backups.
-
Option to disable delta syncs.
-
Option to only use rsync.
-
Advanced: Choose the extension used for snapshots.
-
Advanced: Option to fallback to standard backups if snapshot creation fails.
-
Advanced: Option to pause VMs instead of shutting them down during standard backups. Could result in unusable backups.
-
Advanced: Option to keep specific VMs running during backup. Not recommended.
-
Advanced: Option to enable reconstruct write during backups.
-
Advanced: Option to compare files and retry backup in the event of failure.
-
Advanced: Option to skip backing up xml configuration.
-
Advanced: Option to skip backing up nvram.
-
Advanced: Option to skip backing up vdisks.
-
Advanced: Choose the number of times to check if a VM is shut down.
-
Advanced: Choose the number of seconds to wait between checks to see if a VM is shut down.
I do not make any guarantees as to the function of this script. It is provided as-is. Use at your own risk.