Sunday, July 12, 2009

Schedule cron jobs to send sms on mobile

I've got a weekly shutdown for our Websphere servers for a Database backup. To keep an eye on the logs as the shutdown procedures happen, I've got this cron entry



# Shut down Websphere Portal for Oracle backup every Thursday 12:05 midnight and start next morning 4:15 AM
05 00 * * 5 /etc/init.d/websphere_portal stop 2>&1 > /root/portal-stop.log; echo $HOSTNAME >> /root/portal-stop.log; tail -n 6 /root/portal-stop.log | mailx 'nabeel@smsserver.domain.tld'
15 04 * * 5 /etc/init.d/websphere_portal start 2>&1 > /root/portal-start.log; echo $HOSTNAME >> /root/portal-start.log; tail -n 6 /root/portal-start.log | mailx 'nabeel@smsserver.domain.tld'

So I get the last 6 lines in my mobile inbox as SMS

No comments: