• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

operate mysqldump through plesk schedule task

Noturns

Regular Pleskian
I was fiddling around with mysqldump commands but i cant seem to get those working in Scheduled Tasks. Although i use the plesk internal backups i would like to setup an off-site backup also which copies the db-export to a SFTP location.

I used a Scheduled Task with ROOT permission

example:
Code:
mysqldump -u username -p password --all-databases > db-export.sql

results:
Code:
Task "mysqldump -u username -p secret --all-databases > db-export.sql" completed with error in 2 seconds, output:

Usage: mysqldump [OPTIONS] database [tables]
OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help

I also tried a Scheduled Task with MYSQL permission instead of ROOT permission, which resulted in "Permission denied" - which i found a bit odd....

I can run the command without problem through terminal as root/sudo.
How come this does not work in plesk as root?

As a workaround i tried to create a bash-file and execute that bash-file through scheduled tasks, but got the same result.

I tried a forum search on mysqldump and sheduled task, but could not find a solution. I feel this is maybe a rookie question. I look forward in reading your replies.

Best regards,
 
I had also problems and IgorG command works but only when I put Notify to Every time. If it is on Errors only it doesn't work. Maybe bug in Plesk?
 
Back
Top