Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

graememullins's avatar

Schedule Task in Plesk

Hi,

How can the single cron be added in Plesk?

When I add: * * * * * cd /var/www/vhosts/mydomain/httpdocs && php artisan schedule:run >> /dev/null 2>&1

I get the error,

Error: crontabmng failed: /usr/bin/crontab execution failed: "/usr/local/psa/tmp/ssswVSkJR":2: bad command errors in crontab file, can't install. System error: crontab execution error Search for related Knowledge Base articles

Graeme

0 likes
4 replies
LaryAI's avatar
Level 58

To schedule a task in Plesk, you can follow these steps:

  1. Log in to your Plesk control panel.
  2. Go to the "Scheduled Tasks" section.
  3. Click on "Add Task" or "Add New Task" button.
  4. Fill in the required fields:
    • Task type: Select "Run a command".
    • Command: Enter the command you want to run. In this case, it would be cd /var/www/vhosts/mydomain/httpdocs && php artisan schedule:run >> /dev/null 2>&1.
    • Run: Select the desired frequency for the task.
    • Description: Optionally, provide a description for the task.
  5. Click on the "OK" or "Apply" button to save the task.

Make sure to replace mydomain with the actual domain name or path to your project.

If you still encounter any issues, it's possible that the command you're trying to run is not correct or there might be some other configuration problem. In that case, you may need to consult the Plesk documentation or contact their support for further assistance.

cd /var/www/vhosts/mydomain/httpdocs && php artisan schedule:run >> /dev/null 2>&1
graememullins's avatar

I've added this and get the error: Task "/var/www/vhosts/mydomain/httpdocs && php artisan schedule:run >> /dev/null 2>&1" completed with error in 0 seconds, output:

/bin/sh: /var/www/vhosts/mydomain/httpdocs: Is a directory

graememullins's avatar

I have the Laravel Toolkit installed and get:

Enabling scheduled tasks requires SSH access to the server. Enable it in "Web Hosting Access".

How should this be enabled?

Graeme

Grim's avatar

You can enable SSH access on: your domain > Hosting & DNS > Hosting > SSH access: /bin/bash. This also need to be set if you have any additional Git deployment actions.

Please or to participate in this conversation.