Hello again, I have a script on my media server that wakes up my backup server, performs an 'rsync' backup, then shuts the backup server down. Currently, I have it send the Wake on LAN packet, and sleep for 5 minutes, just to give the backup server time to boot (of course it doesn't take that long, but just in case...). It occurred to me today that that isn't always going to cut it, in the sense that after so many days, the filesystem gets run through fsck (which takes a bit of time on these monster drives).
So, the question... Is it possible to include in a script, maybe a ping mechanism that can be run, then based on the results, determine if the remote server is booted or not? I did some reading on 'ping' (remember, I did use FNG in the title
) and the man page made a mention of using ping's exit status to determine if a server was up or not, but I honestly am not clear on exactly how I would implement that (i.e. if I used:
if [ ping remotehost ]
then blahblah
else blahblahblah
fi
would that necessarily be looking for the exit code 0 (successful), or am I just way out there? The example above seems to be missing something, but... Thanks again, you guys/girls are a great help!