Cronjob does not run on my account

Status
Not open for further replies.

trendsenv44

New Member
Messages
1
Reaction score
0
Points
0
Hello x10 administrator,

I have registered today with the following subdomain trendenv.x10.mx

I have set an Cron Email, and I have created a PHP script, and set the following cronjobs:
There are six cronjobs because they are all not working.

  • 25 * * * * /usr/bin/php /home/trendenv/public_html/{script}.php
    10 * * * * /usr/bin/php /home/trendenv/public_html/{script}.php
    35 * * * * /public_html/{script}.php
    5 * * * * /usr/bin/php /public_html/{script}.php
    45 * * * * /usr/local/bin/php /home/trendenv/public_html/{script}.php
    55 * * * * php /home/trendenv/public_html/{script}.php

As you see, much to much cronjobs, but they arent working. I need just one. I have literally tried all suggestions about cronjobs I have found on this forum. Also I have Googled for it. I think there must be something wrong with the Cron Job permissions?
(I read about permissions on the forum)

Thank you!

Kind regards,

Trend
 
Last edited:

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
Try using wget instead of php.

Code:
wget -O - -q -t 1 "http://yourdomain.example/path/to/file.php"

I think the method you are using now will work if you add -q, but I would think wget is the preferred way since the environment is CGI mode and not CLI, which most users are not familiar with and may cause problems because environmental variables are not set the same, amongst other things.

Code:
/usr/bin/php -q /home/user/public_html/path/to/file.php
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
1. The email notification system has been disabled because an email for a 5 minute cron times thousands of accounts would bog down the mail server

2.

Code:
/usr/bin/php /home/igor/public_html/cron_script.php >>/home/igor/public_html/cron_log.txt 2>&1

will run the script and put any output (echo, print, system errors, etc) into the log file that you can check.

This also allows you to put the script in a directory that is not accessible from the web, for security (once you have checked and debugged it. Being able to run it from the web is a good debugging tool).

3. mail() in the above manner fails. Possibly due to being run via command rather than via Apache. Have not checked it using wget.
 
Last edited:
Status
Not open for further replies.
Top