I have a service I need to restart every hour. I'm using Ubuntu 12.04 LTS and I don't really seem to find a script suitable restarting a service based on a prefixed time setting. How do I restart the service automatically through a script?
Open crontab by command:
crontab -e
To run a command every 60 minutes:
*/60 * * * * /path/to/command
Replace /path/to/command with command to restart service.
It may look like this when you want to restart mysql:
*/60 * * * * service mysqld restart
More information can be found at http://www.ubuntututorials.com/use-crontab-ubuntu/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With