A quick and dirty script to backup Openstack config files
You will of course need to run ssh-copy-id root@hostname
for each machine you want to connect to prior to running this script.
1 #!/bin/bash
2 # declare an array called array and define 3 vales
3 osdirs=( "/etc/nova" "/etc/neutron" "/etc/cinder" "/etc/glance" "/etc/keystone" "/etc/httpd" )
4 servers=("vm-os-ks01" "vm-os-glance01" "vm-os-dash01" "vm-os-net01" "vm-os-net02" "vm-os-cinder01" "vm-os-radosgw01" )
5
6 for s in "${servers[@]}"
7 do
8 for d in "${osdirs[@]}"
9 do
10 echo "Server $s Dir $d"
11 scp -r root@$s:$d /root/backups/$s/$d
12 done
13 done