X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=gnt-backup.sh;h=5e6ac46efcf44d6ea1f3cd370ca77116b0c0251d;hb=9795f895d35669dcc44362e7f7c6bbc2d595d392;hp=e6ffc8f1979939f646163cdf208a18ca97fef2d9;hpb=b392cd18bad8e411a4e39816628d876ef49ab749;p=gnt-info diff --git a/gnt-backup.sh b/gnt-backup.sh index e6ffc8f..5e6ac46 100755 --- a/gnt-backup.sh +++ b/gnt-backup.sh @@ -1,17 +1,26 @@ #!/bin/sh -xe -instance=$1 -node=arh-hw -ganeti_export=arh-hw/ganeti/export +node=`hostname -s` +zfs_nfs=lib10 +ganeti_export=lib10/arh-hw/ganeti/export + +while true ; do -if [ -z "$instance" ] ; then - ssh $node zfs list -t all -r $ganeti_export +if [ -z "$1" ] ; then + ssh root@$zfs_nfs zfs list -o name,written,compressratio -t snapshot -r $ganeti_export exit 0 fi +mount | grep /var/lib/ganeti/export || mount $zfs_nfs:/var/lib/ganeti/export /var/lib/ganeti/export/ + +instance=$1 gnt-instance list -o name,status,oper_vcpus,oper_ram,disk_usage,pnode,snodes $instance gnt-backup export --noshutdown -n $node $instance || true # ignore error on swap partition -ssh $node zfs snap ${ganeti_export}@`date +%Y-%m-%d`_${instance} +ssh root@$zfs_nfs zfs snap ${ganeti_export}@`date +%Y-%m-%d`_${instance} + +shift +done +umount /var/lib/ganeti/export/