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
To schedule a task in Plesk, you can follow these steps:
Log in to your Plesk control panel.
Go to the "Scheduled Tasks" section.
Click on "Add Task" or "Add New Task" button.
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.
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
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
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.