I use it for two main things:
- Notify me when one of my servers was rebooted (sometimes IT don't tell me in advance)
- Run my services. This is easier than writing an /etc/init.d scripts and I store my servers crontab in the source control, so deploying a new machine is easier.
# Notify that machine was rebooted
@reboot /path/to/mail -s "Machine $HOSTNANE rebooted" me@somewhere.com < /dev/null
# Run my server
@reboot (cd /path/to/awesome/server/directory && ./run_server)
Where run_server is usually something like:
#!/bin/bash
nohup ./server.py&
1 comment:
Oh cool, I was looking for something like it but it wasnt important enough to bother you with:)
Now you answer my questions even if I dont ask them lol.
Post a Comment