I have a python script running as a service on Ubuntu11.10. I need to stop the service and then restart it again every 6 hours. I wrote the cronjob and just to check its working, i am stopping and starting the service every 5 mins. Following is the line in my crontab:
*/5 * * * * stop server && start server
I have written the above line in root's crontab. But its not working at all. From CLI the root can stop and start the server absolutely fine. But on automating it using cron, it's not working. Any ideas what I am doing wrong?
Referred the following page for the cronjob syntax.
Referred this as well, but didnt worked for me.
stop
andstart
/sbin/stop
and/sbin/start
, but interesting that you are stopping and starting server.conf, usually you stop and start services through scripts. Is the script a long one, possible to paste it, or just the first few lines? If a cron script fails to run it should log, or send mail. Have you checked roots mail recently?