Resolved Cron Jobs post-cPanel to DirectAdmin

Status
Not open for further replies.

king.semsem80

New Member
Messages
12
Reaction score
0
Points
1
Since the migration, cron jobs have ceased working.

And for the life of me I cannot figure out the proper method to get them to work now...

/home/ACCOUNT/domains/DOMAIN/public_html/DIR/_TO_PHP.php

/usr/local/bin/php -f /home/ACCOUNT/domains/DOMAIN/public_html/DIR/_TO_PHP.php

/usr/local/bin/php -q /home/ACCOUNT/domains/DOMAIN/public_html/DIR/_TO_PHP.php

/usr/bin/php -f /home/ACCOUNT/domains/DOMAIN/public_html/DIR/_TO_PHP.php

None work.

The former cron that worked, that no longer does: /usr/bin/php -f /home/ACCOUNT/public_html/DIR/_TO_PHP.php

Are cron jobs not functional now? At the moment? Am I even remotely close to how they need to be formatted now?
 

Anna

I am just me
Staff member
Messages
11,772
Reaction score
591
Points
113
This should do the trick (that one works on my server at least):

/usr/bin/php -q /home/ACCOUNT/domains/DOMAIN/public_html/DIR/_TO_PHP.php
 

king.semsem80

New Member
Messages
12
Reaction score
0
Points
1
That's not working for me? Also when trying to set up an email alert for cron jobs (to see if anything's even being attempted, I would imagine I should get an email saying it was either successful or not), I'm not getting any emails.
 

Anna

I am just me
Staff member
Messages
11,772
Reaction score
591
Points
113
It might be more efficient to output to a logfile, just append this after the command (after having created the desired logfile) &>> /home/USER/PATH_TO/cronlog.log

In its entirety my command looks like:

/usr/bin/php -q /home/USER/PATH_TO/FILE.php &>> /home/USER/PATH_TO/cronlog.log

I have my php file outside of public_html, not sure that actually makes a difference, but I'll test that quickly and get back to you in a few minutes.
 

Anna

I am just me
Staff member
Messages
11,772
Reaction score
591
Points
113
The same command worked fine when the php file was located in public_html as well.

Also worth noting is that on free hosting you can only have a cron run every 5 minutes, if you specify shorter, or have several that collide within that time, they may not be executed due to restrictions.

There is no hosting account attached with the forum account you write from so I can not check if there's anything specific to your server.
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
252
Points
63
@king.semsem80 I'm closing this thread for inactivity. Please open a new thread if you need further assistance. Thank you.
 
Status
Not open for further replies.
Top