remove snapshots on all nodes in cluster
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 23 Dec 2016 17:49:32 +0000 (18:49 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 23 Dec 2016 17:49:32 +0000 (18:49 +0100)
gnt-lv-remove-snap.sh

index e364851..005f716 100755 (executable)
@@ -1,5 +1,14 @@
-#!/bin/sh -xe
+#!/bin/sh -e
+
+if [ "$1" = "run" ] ; then
 
 dmsetup ls --tree | grep snap-1 | cut -d" " -f1 | xargs -i dmsetup remove {}
 ls /dev/mapper/*snap | xargs -i lvremove -f {}
 
+else
+
+cp $0 /dev/shm/snap-remove.sh
+gnt-cluster copyfile /dev/shm/snap-remove.sh
+gnt-cluster command -M sh -e /dev/shm/snap-remove.sh run
+
+fi