From 29b3a7b16397817bf39a161423279b0145db3abe Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Wed, 19 Jun 2019 09:17:40 +0200 Subject: [PATCH] {VMBACKUP] Forward to latest --- FreeBSD/vm-backup.csh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/FreeBSD/vm-backup.csh b/FreeBSD/vm-backup.csh index e957dff..702eeb3 100644 --- a/FreeBSD/vm-backup.csh +++ b/FreeBSD/vm-backup.csh @@ -17,10 +17,10 @@ foreach vm (`ls /usr/vms | \ vm stop $vm ## give vm time to shut down properly - sleep 5 - + sleep 15 + ## snapshot vm - echo "Snapshot VM: $vm" + echo "Snapshot VM: $vm" zfs snapshot $vm_dataset/$vm@$backup_date echo "" @@ -38,12 +38,16 @@ foreach vm (`ls /usr/vms | \ grep -v .iso | \ grep -v .templates`) + ## Create ZFS dataset + echo "Creating destination dataset for $vm" + zfs create $backup_dataset/$vm-$backup_date + ## Send snapshot to backup destination - echo "Backup VM: $vm" - zfs send $vm_dataset/$vm@$backup_date | pv | zfs recv -F $backup_dataset/$vm + echo "Backup VM: $vm" + zfs send $vm_dataset/$vm@$backup_date | zfs recv -F $backup_dataset/$vm-$backup_date echo "" - ## Delete snapshot + ## Delete snapshot zfs destroy $vm_dataset/$vm@$backup_date end @@ -51,4 +55,4 @@ end # report done echo "" echo "############### ALL DONE THANKS ###############" -echo "" +echo "" \ No newline at end of file