Bobcares

DirectAdmin Cron Job Not Working: Troubleshoot

by | Feb 16, 2023

let us take a closer look at the error Directadmin cron job not working. With the support of our DirectAdmin support services at Bobcares we can give you a detailed overview of the error.

Directadmin cron job not working

Cron is a Linux function that allows us to schedule a command or script on the server to do repeated activities automatically.

directadmin remote mysql

Scripts run as cron jobs are often used to edit files or databases; but, they can also conduct non-data-modifying operations on the server, such as sending email notifications.

DirectAdmin cron job not working: troubleshooting:

Cron jobs may not operate directly on admin since some processes may require authentication.

Sample php file name mail.php

?php
// the message
$msg = "First line of text\nSecond line of text";
// use wordwrap() if lines are longer than 70 characters
$msg = wordwrap($msg,70);
// send email
mail("ecd@abcd.com","My subject",$msg);
?

Cron command:

For the URl type in the following line:

* * * * * wget http://abcd.com/mail.php &> /dev/null

And after that for the path use the following line:

* * * * * /mail.php

This cron job send mail every minute Check The “Cron Jobs” setting in DirectAdmin’s “Profile Setup” -> “Account Configuration” is enabled.

Write to a log file instead of /dev/null to see what’s going on with the process.

/usr/bin/php -q /home/......./something.php 2&1 /home/[username]/cronlog.txt

This log will get big quickly. Once we’ve established it’s running correctly, pipe the output to /dev/null

We have to check that the path to the PHP file has all 0755 permissions and that the file has 0644 permissions. For example, every folder must be 0755. A permissions problem might occur if the size of any folder is less than 0755.

Turn on error reporting in the PHP script in case it’s an error such as one caused by using PHP 7.2 (and the script has some legacy code), which is going to be the version of /usr/bin/php.

[Need assistance with similar queries? We are here to help]

Conclusion

To sum up, we have now seen how to manage the DirectAdmin cron job not working error. With the support of our, DirectAdmin managed services we have gone through all of the solutions.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.