diff --git a/restore.sh b/restore.sh new file mode 100755 index 0000000..8ada6cb --- /dev/null +++ b/restore.sh @@ -0,0 +1,19 @@ +#!/bin/bash +vm=$1 +date=$2 +disk=$3 +destpath=$4 + +if [[ $# != 4 ]] +then + echo "ERROR: 4 parameters required (vm, date, disk, destination)" + exit 1 +fi + +backup_file=$(sudo virt-backup list -D ${vm} | grep ${date} | cut -d " " -f 2 | sed "s/.json/_${disk}.raw/g") + +echo "Restoring for $backup_file" +sudo cp --sparse=always -v "$backup_file" "$destpath" + + +