tweetnest icon indicating copy to clipboard operation
tweetnest copied to clipboard

crontab not working

Open fritzweisshart opened this issue 9 years ago • 4 comments

Calling loadtweets.php in the browser works. loadlog.txt shows attempt: Attempted load Mon, 06 Apr 2015 16:09:47 +0200

But a crontab like the following doesn't work: 50 1 * * * php /server path//tweetnest/maintenance/loadtweets.php No entry in loadlog.txt

Any idea? Is my crontab syntax wrong?

fritzweisshart avatar Apr 06 '15 14:04 fritzweisshart

Does the path to loadtweets.php contain a space?

50 1 * * * php /server path//tweetnest/maintenance/loadtweets.php

Your crontab syntax is correct, but I think what it means is "run the command php with 2 arguments, /server and path//tweetnest/maintenance/loadtweets.php at 01:50 every day".

Adding a backslash to the path like this might work:

50 1 * * * php /server\ path//tweetnest/maintenance/loadtweets.php

alexmuller avatar Apr 06 '15 19:04 alexmuller

Sorry, of course there is no space in the path. Imagine something like 0 1 * * * php /web/html/xyz/blabla//tweetnest/maintenance/loadtweets.php

fritzweisshart avatar Apr 06 '15 19:04 fritzweisshart

Ah ok, that syntax looks right to me - if you try running that command at the prompt do you get any useful output?

php /web/html/xyz/blabla//tweetnest/maintenance/loadtweets.php

alexmuller avatar Apr 06 '15 20:04 alexmuller

Thank you. I figured out, where the cronjob writes its output - and the error log. The Problem was: loadtweets.php needs PHP with curl support, and curl was not installed where cronjobs run.

fritzweisshart avatar Apr 07 '15 15:04 fritzweisshart