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

 

#!/bin/bash
# declare an array called array and define 3 vales
osdirs=( "/etc/nova" "/etc/neutron" "/etc/cinder" "/etc/glance" "/etc/keystone" "/etc/httpd" )
servers=("vm-os-ks01" "vm-os-glance01" "vm-os-dash01" "vm-os-net01" "vm-os-net02" "vm-os-cinder01" "vm-os-radosgw01" )

for s in "${servers[@]}"
do
    for d in "${osdirs[@]}"
    do
        echo "Server $s Dir $d"
        scp -r root@$s:$d /root/backups/$s/$d
    done
done