Bobcares

Running a Cron job via Scheduled Tasks in Plesk fails | Fixed

by | Mar 2, 2022

Running a Cron job via Scheduled Tasks in Plesk fails is no longer a problem with Bobcares by your side. 

At Bobcares, we offer solutions for every query, big and small, as a part of our Server Management Services.

Let’s take a look at how our Support Team is ready to help customers run a Cron job via Scheduled Tasks in Plesk.

Why Running a Cron job via Scheduled Tasks in Plesk fails

Some of our customers have been facing a bit of trouble while attempting to execute a task on schedule that runs a command to execute a script in Plesk. It often results in one of the following error messages:

Task ” php -q /var/www/vhosts/example.com/httpdocs/wp-cron.php” completed with error in 0 seconds, output:

-: /dev/null: Permission denied

Or,

Task ” php -q /var/www/vhosts/example.com/httpdocs/wp-cron.php” completed with error in 0 seconds, output:
-: php: command not found

After careful analysis, our Support Team has come to the conclusion that a missing command in the chroot environment or a lack of permission on the script file is the cause behind the error. Fortunately, our proficient Support Techs have come up with a solution to resolve the issue:

  1. First, log in to Plesk.
  2. Then, head to Subscriptions > example.com > Web Hosting Settings > Access to the server over SSH. and modify the shell for the subscription to /bin/bash.

    Before we move on to the next step, our Support Team would like to point out that is not necessary if the executable file is not accessible via the Plesk File Manager.

  3. Next, we modify the permissions or task type.
    • For shell scripts:

      Navigate to the problematic file under Domains > example.com > File Manager and add the following executable permissions:

      Running a Cron job via Scheduled Tasks in Plesk fails

    • For the .php scripts:

      Head to Domains > example.com > Scheduled Tasks > Add Task and recreate the task as Run a PHP script:

      Running a Cron job via Scheduled Tasks in Plesk fails

[Looking for a solution to another query? We are just a click away.]

Conclusion

To sum up, our skilled Support Engineers at Bobcares demonstrated running a Cron job via Scheduled Tasks in Plesk fails

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.