Since the Black-Dragon is primarily a backup computer, I want it to actually do backups. Since it now spends most of it's time off-line, I normally have to boot the system from time to time and run my backups manually. But I never liked that.
The Black Dragon has had Wake-On-LAN ever since I installed the 1 Gbit/sec NIC. It works, but I never tried a batch system because the previous OS couldn't be remotely shutdown. (Actually, Cygwin did have a shutdown command. But it wouldn't actually turn off the computer-- it will simply leave the system on with the message "it is now safe to turn off your computer"... lame). Since the Black Dragon is a Linix box, remotely shutting down is no issue.
The Red-Dragon has to do all the work when it comes to backups, since the Black Dragon is usually asleep. Booting the system isn't a problem-- turning it off takes a little more work. I created no pass phrase SSH key pair. I then put the public key in the authorized users file on the Black-Dragon. This way, I can use a batch file to log in and run a command.
Ubuntu doesn't use the root user. Instead, you log in as some user and "sudo" any root level commands. This makes batches a little more complicated. luckily, you can pipe in the password for sudo. So here is my backup shell script:
#! /bin/sh
echo "Waking the Black-Dragon..."
/usr/local/bin/wol 00:09:5B:8F:62:8F
echo "Wating for the Black-Dragon to boot..."
/bin/sleep 90
echo "Archiving DSP projects..."
cmd /c D:\Projects\DSP\Archive.pl
echo "Archiving PC projects..."
cmd /c D:\Projects\PC_Based\Archive.pl
echo "Archiving photos..."
cmd /c D:\Media\Graphics\Capture\Archive.pl
echo "Shutting down Black-Dragon"
ssh que@192.168.0.96 'echo ******|sudo shutdown -h now'
The first command is the Wake-On-LAN. Then, it script sleeps for a minute and a half to give the system time to boot up. Then, three different archive scripts run. Afterwards, the script SSHes in and tells the system to shutdown. The "echo" pipes the password to "sudo". And that's it... the system boots up, backs up and shuts back down.