I have decided that, by permission of.... , both machines will be on a different domain.
Therefor
- ping will not work
- snmp traps are under investigation
- ssh can work, see below.
I want to let the backup server check if the server at home is awake, if not, let wake it.
That could pose a problem if my Zyxel router does not support wol.
As far as I understood the entry for a pc with a certain mac/ip-address in the arp table stays active for 300 seconds in a router.
I need to check if I can manipulate this manually.
Nevertheless I have a backup plan.
I have a hp thin client which is relative power-friendly which I can leave powered-on.
So the wol of the server can be controlled from this thin client.
basically the back-up server script would look something like (give or take ...) :
Code:
#!/bin/sh
# only works with keys
ssh $USER@$SERVER exit
if [ $? = 0 ]
then
#server alive, start rsync
ssh $USER@SERVER "/etc/rc.d/rc.backup"
else
#server not alive, wake up via thin-client
ssh $USER@$THIN_CLIENT "/etc/rc.d/rc.wol"
#wait at least 60 seconds
sleep 60
# then check every 10 seconds
for i in $(seq 1 1 10)
do
ssh $USER@$SERVER exit
if [ $? = 0 ]
then
#server alive, start rsync
ssh $USER@SERVER "/etc/rc.d/rc.backup"
# we are done, exit
exit
fi
sleep 10
done
fi
best regards
ST