Jump to content

Cron Job Problem


mostafatalebi

Recommended Posts

Hello everybody

 

I have set up a cronJob but it keeps sending error report to my mail.

 

These are the errors:

(I have removed the full server path before the cron.php which is home/..../)

cron.php: line 1: ?php: No such file or directory

cron.php: line 2: /backup: is a directory
cron.php: line 3: access-logs: command not found
cron.php: line 4: access-logs: command not found
cron.php: line 5: access-logs: command not found
cron.php: line 6: access-logs: command not found
cron.php: line 7: access-logs: command not found
cron.php: line 8: access-logs: command not found
cron.php: line 9: access-logs: command not found
cron.php: line 10: access-logs: command not found
cron.php: line 11: access-logs: command not found
cron.php: line 12: access-logs: command not found
cron.php: line 13: access-logs/: is a directory
cron.php: line 16: //: is a directory
cron.php: line 17: syntax error near unexpected token `('
cron.php: line 17: `$mydir = dirname(__FILE__);'

 

 

 

 

What shall I do?

 

Link to comment
https://forums.phpfreaks.com/topic/277225-cron-job-problem/
Share on other sites

If you want to execute a PHP file in the cron, you need to specify the path to the PHP command line interpreter. If you're using linux, this is generally "/usr/bin/php"

 

So the cron would look like:

 

* * * * * /usr/bin/php /path/to/file.php

 

Replacing * for whatever time values you actually want

Link to comment
https://forums.phpfreaks.com/topic/277225-cron-job-problem/#findComment-1426905
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.