summaryrefslogtreecommitdiffstats
path: root/roles/ands_backup/templates/backup.sh.j2
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-03-24 03:05:47 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-03-24 03:05:47 +0100
commit5a15f65db3dfb245919bdd534e93bd711db2eb60 (patch)
tree431e6cc7476a0c2e135983a937a9d2e6f184fe5e /roles/ands_backup/templates/backup.sh.j2
parentc163108c0c0c7b7a4f05da411e98ac0f503e31e0 (diff)
downloadands-5a15f65db3dfb245919bdd534e93bd711db2eb60.tar.gz
ands-5a15f65db3dfb245919bdd534e93bd711db2eb60.tar.bz2
ands-5a15f65db3dfb245919bdd534e93bd711db2eb60.tar.xz
ands-5a15f65db3dfb245919bdd534e93bd711db2eb60.zip
Minor tunning
Diffstat (limited to 'roles/ands_backup/templates/backup.sh.j2')
-rwxr-xr-xroles/ands_backup/templates/backup.sh.j211
1 files changed, 9 insertions, 2 deletions
diff --git a/roles/ands_backup/templates/backup.sh.j2 b/roles/ands_backup/templates/backup.sh.j2
index c362957..b9884ea 100755
--- a/roles/ands_backup/templates/backup.sh.j2
+++ b/roles/ands_backup/templates/backup.sh.j2
@@ -37,13 +37,20 @@ etcdctl3 --endpoints="192.168.213.1:2379" snapshot save "$backup_path/etcd/snaps
mkdir -p "$backup_path/heketi" || { echo "Can't create ${backup_path}/heketi" ; exit 1 ; }
heketi-cli -s http://heketi-storage.glusterfs.svc.cluster.local:8080 --user admin --secret "$(oc get secret heketi-storage-admin-secret -n glusterfs -o jsonpath='{.data.key}' | base64 -d)" topology info > "$backup_path/heketi/heketi_topology.json"
heketi-cli -s http://heketi-storage.glusterfs.svc.cluster.local:8080 --user admin --secret "$(oc get secret heketi-storage-admin-secret -n glusterfs -o jsonpath='{.data.key}' | base64 -d)" db dump > "$backup_path/heketi/heketi_db.json"
-lvs > "$backup_path/heketi/lvs.txt" 2>/dev/null
-lvm fullreport --reportformat json > "$backup_path/heketi/lvm.json" 2>/dev/null
gluster --xml volume info > "$backup_path/heketi/gluster-info.xml"
gluster --xml volume status > "$backup_path/heketi/gluster-status.xml"
gluster volume status > "$backup_path/heketi/gluster.txt"
{% endif %}
+mkdir -p "$backup_path/lvm" || { echo "Can't create ${backup_path}/lvm" ; exit 1 ; }
+lvs > "$backup_path/lvm/lvs.txt" 2>/dev/null
+lvm fullreport --reportformat json > "$backup_path/lvm/lvm.json" 2>/dev/null
+dmsetup ls --tree > "$backup_path/lvm/dmesetup.txt" 2>/dev/null
+vglist=$(vgdisplay | grep -oP "VG Name\s+\K.*")
+for vg in $vglist; do
+ vgcfgbackup -f "$backup_path/lvm/vg-$vg.backup" "$vg" &>/dev/null
+done
+
{% if 'ands_storage_servers' in group_names %}
# Gluster