Script de restauration virt-backup
This commit is contained in:
parent
dac2f3fb2d
commit
5384129802
|
@ -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"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue