diff options
Diffstat (limited to 'handlers')
| -rw-r--r-- | handlers/ldap | 12 | ||||
| -rw-r--r-- | handlers/mysql | 38 | ||||
| -rw-r--r-- | handlers/rdiff | 26 | ||||
| -rwxr-xr-x | handlers/sys | 6 | 
4 files changed, 41 insertions, 41 deletions
diff --git a/handlers/ldap b/handlers/ldap index 06e4e28..9ead9d1 100644 --- a/handlers/ldap +++ b/handlers/ldap @@ -47,20 +47,20 @@ if [ "$ldif" == "yes" ]; then  			fatal "Couldn't create ldif dump file: $dumpdir/$dbsuffix.ldif"  		fi  		execstr="$SLAPCAT -f $conf -b $dbsuffix -l $dumpdir/$dbsuffix.ldif" -		debug 0 "$execstr" +		debug "$execstr"  		if [ ! $test ]; then  			output=`$execstr`  			code=$?  			if [ "$code" == "0" ]; then -				debug 0 $output -				debug 1 "Successfully finished ldif export of $dbsuffix" +				debug $output +				info "Successfully finished ldif export of $dbsuffix"  			else -				debug 2 $output -				debug 2 "Failed ldif export of $dbsuffix" +				warning $output +				warning "Failed ldif export of $dbsuffix"  			fi  			if [ "$compress" == "yes" ]; then  				output=`$GZIP -f "$dumpdir/$dbsuffix.ldif" 2>&1` -				debug 0 $output +				debug $output  			fi  		fi  	done	 diff --git a/handlers/mysql b/handlers/mysql index 4439bcc..165ebc6 100644 --- a/handlers/mysql +++ b/handlers/mysql @@ -33,7 +33,7 @@ if [ "$dbusername" != "" ]; then  	if [ -f $mycnf ]; then  		# rename temporarily  		tmpcnf="$home/my.cnf.disable" -		debug 0 "mv $mycnf $tmpcnf" +		debug "mv $mycnf $tmpcnf"  		mv $mycnf $tmpcnf  	fi  	oldmask=`umask` @@ -60,31 +60,31 @@ fi  if [ "$hotcopy" == "yes" ]; then   	if [ "$databases" == "all" ]; then  		execstr="$MYSQLHOTCOPY --quiet --allowold --regexp /.\*/./.\*/ $hotdir" -		debug 0 "su $user -c '$execstr'" +		debug "su $user -c '$execstr'"  		if [ ! $test ]; then  			output=`su $user -c "$execstr" 2>&1`  			code=$?  			if [ "$code" == "0" ]; then -				debug 0 $output -				debug 1 "Successfully finished hotcopy of all mysql databases" +				debug $output +				info "Successfully finished hotcopy of all mysql databases"  			else -				debug 2 $output -				debug 2 "Failed to hotcopy all mysql databases" +				warning $output +				warning "Failed to hotcopy all mysql databases"  			fi  		fi  	else	  		for db in $databases; do  			execstr="$MYSQLHOTCOPY --allowold $db $hotdir" -			debug 0 "su $user -c '$execstr'" +			debug "su $user -c '$execstr'"  			if [ ! $test ]; then  				output=`su $user -c "$execstr" 2>&1`  				code=$?  				if [ "$code" == "0" ]; then -					debug 0 $output -					debug 1 "Successfully finished hotcopy of mysql database $db" +					debug $output +					info "Successfully finished hotcopy of mysql database $db"  				else -					debug 2 $output -					debug 2 "Failed to hotcopy mysql database $db" +					warning $output +					warning "Failed to hotcopy mysql database $db"  				fi  			fi  		done @@ -100,32 +100,32 @@ if [ "$sqldump" == "yes" ]; then  	for db in $databases; do  		execstr="$MYSQLDUMP --lock-tables --complete-insert --add-drop-table --quick --quote-names $db > $dumpdir/${db}.sql" -		debug 0 "su $user -c '$execstr'" +		debug "su $user -c '$execstr'"  		if [ ! $test ]; then  			output=`su $user -c "$execstr" 2>&1`  			code=$?  			if [ "$code" == "0" ]; then -				debug 0 $output -				debug 1 "Successfully finished dump of mysql database $db" +				debug $output +				info "Successfully finished dump of mysql database $db"  			else -				debug 2 $output -				debug 2 "Failed to dump mysql databases $db" +				warning $output +				warning "Failed to dump mysql databases $db"  			fi  		fi  	done  	if [ "$compress" == "yes" ]; then  		output=`$GZIP -f $dumpdir/*.sql 2>&1` -		debug 0 $output +		debug $output  	fi  fi  if [ "$dbusername" != "" ]; then  	## clean up tmp config file -	debug 0 "rm $mycnf" +	debug "rm $mycnf"  	rm $mycnf  	if [ -f "$tmpcnf" ]; then -		debug 0 "mv $tmpcnf $mycnf" +		debug "mv $tmpcnf $mycnf"  		mv $tmpcnf $mycnf  	fi  fi diff --git a/handlers/rdiff b/handlers/rdiff index 1f2058f..90ca2a3 100644 --- a/handlers/rdiff +++ b/handlers/rdiff @@ -6,7 +6,7 @@  setsection source  getconf type; sourcetype=$type  getconf label -getconf user; sourceuser=$user +getconf user root; sourceuser=$user  getconf keep  getconf include  getconf exclude @@ -25,7 +25,7 @@ getconf host; desthost=$host  [ "$desttype" == "remote" ] || fatal "Only remote destinations are supported"  # see if we can login -debug 0 "su $sourceuser -c \"ssh -o PasswordAuthentication=no $desthost -l $destuser 'echo -n 1'\"" +debug "su $sourceuser -c \"ssh -o PasswordAuthentication=no $desthost -l $destuser 'echo -n 1'\""  if [ ! $test ]; then  	result=`su $sourceuser -c "ssh -o PasswordAuthentication=no $desthost -l $destuser 'echo -n 1'" 2>&1`  	if [ "$result" != "1" ]; then @@ -34,7 +34,7 @@ if [ ! $test ]; then  fi  # see that rdiff-backup has the same version as here -debug 0 "su $sourceuser -c \"ssh $desthost -l $destuser '$RDIFFBACKUP -V'\"" +debug "su $sourceuser -c \"ssh $desthost -l $destuser '$RDIFFBACKUP -V'\""  if [ ! $test ]; then  	remoteversion=`su $sourceuser -c "ssh $desthost -l $destuser '$RDIFFBACKUP -V'" 2>&1`  	localversion=`$RDIFFBACKUP -V` @@ -62,16 +62,16 @@ if [ "$keep" -gt "0" ]; then  	fi  	removestr="${removestr}${destdir}/${label}"; -	debug 0 "su $sourceuser -c '$removestr'" +	debug "su $sourceuser -c '$removestr'"  	if [ ! $test ]; then  		output=`su $sourceuser -c "$removestr" 2>&1`  		code=$?  		if [ "$code" == "0" ]; then -			debug 0 $output -			debug 1 "Removing backups older than $keep days succeeded." +			debug $output +			info "Removing backups older than $keep days succeeded."  		else -			debug 2 $output -			debug 2 "Failed removing backups older than $keep." +			warning $output +			warning "Failed removing backups older than $keep."  		fi  	fi  fi @@ -100,16 +100,16 @@ execstr="${execstr}--exclude '/*' "  # include client-part and server-part  execstr="${execstr}$execstr_clientpart $execstr_serverpart" -debug 0 "su $sourceuser -c '$execstr'" +debug "su $sourceuser -c '$execstr'"  if [ ! $test ]; then  	output=`su $sourceuser -c "$execstr" 2>&1`  	code=$?  	if [ "$code" == "0" ]; then -		debug 0 $output -		debug 1 "Successfully finished backing up source '$label'" +		debug $output +		info "Successfully finished backing up source '$label'"  	else -		debug 2 $output -		debug 2 "Failed backup up source '$label'" +		warning $output +		warning "Failed backup up source '$label'"  	fi  fi	 diff --git a/handlers/sys b/handlers/sys index 35a3919..140db76 100755 --- a/handlers/sys +++ b/handlers/sys @@ -28,21 +28,21 @@ getconf hardwarefile /var/backups/hardware.txt  if [ "$packages" == "yes" ]; then  	if [ ! -x "`which dpkg`" ]; then -		debug 2 "can't find dpkg, skipping installed packages report." +		warning "can't find dpkg, skipping installed packages report."  		packages="no"  	fi  fi  if [ "$partitions" == "yes" ]; then  	if [ ! -x "`which sfdisk`" ]; then -		debug 2 "can't find sfdisk, skipping partition report." +		warning "can't find sfdisk, skipping partition report."  		partitions="no"  	fi  fi  if [ "$hardware" == "yes" ]; then  	if [ ! -x "`which discover`" ]; then -		debug 2 "can't find discover, skipping hardware report." +		warning "can't find discover, skipping hardware report."  		hardware="no"  	fi  fi  | 
