HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=25)
-   -   Cron does not work (http://www.howtoforge.com/forums/showthread.php?t=49694)

marcoslavorato 27th October 2010 21:23

Cron does not work
 
Hello all. I have a problem configuring the crontab on my server. I follow this steps.

1. Edit using nano crontab -e command
2. Add this lines
Code:

Code:

0 24 * * * php /root/scripts/backup_mysql.php
15 * * * * wget -q -O /dev/null http://domain.com/cronjob/atualiza-horas

3. Save the file and run the /sbin/service crond start command

This both cronjobs does not execute. How can I make this work? The second cronjob is without the link.

till 27th October 2010 21:28

You have to use the full path to applications in cronjobs. E.g. /usr/bin/php and not just php

marcoslavorato 27th October 2010 21:30

Quote:

Originally Posted by till (Post 242998)
You have to use the full path to applications in cronjobs. E.g. /usr/bin/php and not just php

Thanks till. And the second command, do you know why does not work?

till 27th October 2010 22:25

Same reason. You have to use the full path for every command that you use in a cronjob. If you dont know the full path, then you can get it with the which command. e.g.

which wget

marcoslavorato 27th October 2010 23:44

till, thanks again but it still no working. Look how is my cron file. I tried in the log but I can't found anything.

Code:

0 24 * * * /usr/bin/php "/root/scripts/backup_mysql.php"
15 * * * * /usr/bin/wget -q -O /dev/null http://domain.com/cronjob/atualiza-horas

Quote:

Originally Posted by till (Post 243002)
Same reason. You have to use the full path for every command that you use in a cronjob. If you dont know the full path, then you can get it with the which command. e.g.

which wget


marcoslavorato 28th October 2010 00:41

Thanks till, working fine, now.


All times are GMT +2. The time now is 00:08.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.