Commits

Xenith Orb committed 750292a

Aesthetic touchups

Comments (0)

Files changed (1)

 #!/bin/bash
 #
-# This is a script for mirroring a volume group using LVM snapshots, dd, netcat(nc), and bzip2
+# This is a script for mirroring a volume group using LVM snapshots, dd, netcat(nc), and gzip
 # Assumptions are that you have the above dependencies installed and configured properly
 # you will also need root on the remote machine, and a running SSHd (unless you choose to run 
 # the script withotu using the remote commands.) Alternatively they can be run locally at the 
-# remote machine. 
+# remote machine. In addition to that, having proper keyfile authorization with SSH is a plus.
 #							
 #  10/14/2012 - Xenith Orb		
 #	
 BYTE_SIZE="8M"	       # Byte size to use with dd 
 #PORT="9000"	       # Port to use with netcat
 REMOTE_HOST="vm-local" # DNS or IP addr of remote machines
+SCRIPTNAME="${0##*/}"  # Get name of script from cmdline
 ############################################################################
 
-SCRIPTNAME="snapshot.sh"
 get_names_and_sizes () {
 	local table=(  $( lvs | tail -n+2 | grep ${SOURCE_VGNAME} | grep -v "${SUFFIX}" |\
 			awk '{print $1"\t"$4}' | sed 's/.00g//') ) 
 	done
 }
 delete_remote_lvolumes () {
-	#vgscan ## just in case : not needed for remote w/ ssh
 	for lvname in ${vol_name[@]}; do 
 		ssh root@${REMOTE_HOST} "lvremove -f /dev/${TARGET_VGNAME}/${lvname}"
 	done 
 }
 create_remote_lvolumes () {
-	#vgscan ## just in case : not needed for remote w/ ssh
 	local count=0
 	for lvname in ${vol_name[@]}; do 
 		ssh root@${REMOTE_HOST} "lvcreate -L \"${vol_size[$count]}G\" -n ${lvname} ${TARGET_VGNAME}"
 	   exit 1
 	;;
 esac
-
-