• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

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