Running a command on reboot with cron
While investigating the whenever gem, which allows you to schedule cron jobs as part of your Ruby project, I learned something new about cron. You can start a process on reboot with this syntax:
@reboot /path/to/command
In addition to allowing a non root user to execute commands on startup, the @reboot
option allows you to keep your server deployment dependencies (sphinx, thin, etc.) in a single location. Sweet.