• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

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