> Then the part to contend with is updating the "ping" script to return
> positively only when the expected OS for the respective host names is
> running.
I've done something similar in the past, on a machine that had an
encrypted home directory. It also lived on either wired or wireless,
so the wrapper took care of that too. (The host name was different
in the two cases: "host" or "airhost".)
paul
The host's config file looked like this:
# "dual_commands" also takes care of broom vs. airbroom
$Conf{PingPath} = '/var/lib/backuppc/pc/broom/dual_commands';
$Conf{PingCmd} = '$pingPath fileping $host';
# use the same wrapper to force try on both "broom" and "airbroom"
$Conf{SshPath} = '/var/lib/backuppc/pc/broom/dual_commands';
$Conf{RsyncClientCmd} = '$sshPath backup $host $rsyncPath
$argList+';
$Conf{RsyncClientRestoreCmd} = '$sshPath restore $host $rsyncPath
$argList+';
------------cut here----------
#!/bin/sh
# this wrapper script can produce absolutely _no_ output of its own,
# at least when doing backups. during just pings output is okay.
#exec >>/tmp/dping.log
#exec 2>&1
#set -x
cmd=$1
shift
test "$1" && host=$1 && shift
test "$1" && rsyncPath=$1 && shift
case $cmd in
ping) ping -c 1 $host || \
ping -c 1 air$host
;;
fileping) # check for file ".backups_ok". it will only exist if unencrypted.
ssh -p 20543 -x -l root $host ls /home/pgf/.backups_ok || \
ssh -p 20543 -x -l root air$host ls /home/pgf/.backups_ok
;;
backup)
if ping -c 1 $host >/dev/null 2>&1
then
ssh -p 20543 -x -l root $host $rsyncPath "$@"
elif ping -c 1 air$host >/dev/null 2>&1
then
ssh -p 20543 -x -l root air$host $rsyncPath "$@"
fi
;;
restore)
if ping -c 1 $host >/dev/null 2>&1
then
ssh -p 20543 -x -l root $host $rsyncPath "$@"
elif ping -c 1 air$host >/dev/null 2>&1
then
ssh -p 20543 -x -l root air$host $rsyncPath "$@"
fi
;;
esac
------------cut here----------
=----------------------
paul fox, [email protected] (arlington, ma, where it's 31.1 degrees)
_______________________________________________
BackupPC-users mailing list
[email protected]
List: https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki: https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/