#!/bin/bash source db2settings.bsh vmrun start "$vm_file" echo "Sleep for 1 min" sleep 30 echo $save_path mkdir -p $save_path echo $machine_ip #echo "Starting the VM" ssh -i id_rsa -t root@$machine_ip "~/reboot.bsh" vmrun start "$vm_file" sleep 60 echo "Start DB2" ssh -i id_rsa -t dbinst1@$machine_ip "~/StartDB2FirstTime.bsh" echo "Dropping and creating the DB" echo "Pausing the vm" vmrun stop "$vm_file" soft sleep 30 ts=`date "+%Y-%m-%d-%H:%M:%S"` mkdir -p $save_path/pass-clean/$ts echo "Copy the vm contents" cp -Rf "$vm_folder" $save_path/pass-clean/$ts echo "#################"