• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Plesk scheduled task failed

conmen80

New Pleskian
I had a dedicated server with Plesk 11.0.9, I scheduled a database backup cron-job to performed daily backup, below is the commands:

Code:
mysqldump -u admin -p`cat /etc/psa/.psa.shadow` database1 > /var/backups/db_backup_`date +\%Y\%m\%d\%H\%M\%S`.sql

I received an email's notification stated with:

Code:
cat: /etc/psa/.psa.shadow: No such file or directory
-: date: command not found
-: date: command not found
-: /var/backups/db_backup_.sql: No such file or directory


I tried logon as root user in SSH console to run the same command, the backup file was created successful, I don't know what's issue to run scheduled task in Plesk is so headaches compared with cPanel, I've been spent whole day to figured out but seems no lucks.

Can someone expert please do me a favour?

Thanks.
 
First of all use full path for command mysqldump. Then use \ symbol for ` - for example:

/usr/bin/mysqldump -uadmin -p\`cat /etc/psa/.psa.shadow\`....
 
If you have created this schedule through Plesk, then firstly ensure that you have allowed shell access to the respective user ..You can do that by editing hosting settings of that user and changing to "bin/bash" shell ..

Let me know if that helps!
 
First of all use full path for command mysqldump. Then use \ symbol for ` - for example:

/usr/bin/mysqldump -uadmin -p\`cat /etc/psa/.psa.shadow\`....

Thanks!

But now I have error notification with:

Code:
-: /var/www/vhosts/mywebsite.com/backups/db_backup_.sql: No such file or directory


the task command line has changed to:

Code:
/usr/bin/mysqldump -u admin -p\`cat /etc/psa/.psa.shadow\` database1 > /var/www/vhosts/mywebsite.com/backups/db_backup_\`/usr/bin/date +\%Y\%m\%d\%H\%M\%S\`.sql


I've been read this link http://download1.parallels.com/Plesk/PP10/10.4.4/Doc/en-US/online/plesk-administrator-guide/index.htm?fileName=66791.htm and did the same and ran command:

Code:
# /usr/local/psa/bin/server_pref -u -crontab-secure-shell "/bin/sh"

and received error:

Code:
/bin/sh: /var/www/vhosts/mywebsite.com/backups/db_backup_`/usr/bin/date: No such file or directory

Any idea?
 
Last edited:
Hello,

Can you please try with the following command and check it

Code:
mysqldump -u admin -p`cat /etc/psa/.psa.shadow` database1 > /var/backups/db_backup_`date +%Y-%m-%d-%H-%M`.sql
 
Back
Top