projects
/
gnt-info
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
document bug and add workaround
[gnt-info]
/
gnt-backup.sh
diff --git
a/gnt-backup.sh
b/gnt-backup.sh
index
93dc448
..
5e6ac46
100755
(executable)
--- a/
gnt-backup.sh
+++ b/
gnt-backup.sh
@@
-1,15
+1,26
@@
#!/bin/sh -xe
#!/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
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
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/