# Cron job not running

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.

• even tried the following in crontab:--- */2 * * * * username stop server && start server – bugs99 Jun 18 '12 at 9:28
• Use the full path for stop and start – Sirch Jun 18 '12 at 9:29
• tried the following:-- */5 * * * * stop /etc/init/server.conf && start /etc/init/server.conf but didnt work. – bugs99 Jun 18 '12 at 9:44
• I meant /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? – Sirch Jun 18 '12 at 9:49
• ok, even /sbin/stop /etc/init/server.conf ....... didnt work. Will try writing those command in a shell script and will try t0 automate that instead. mailx is not installed on the system – bugs99 Jun 18 '12 at 10:00

Have you tried using the full path to the stop and start executables?
What do you see in /var/log/cron.log?