• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • 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.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

How to MySQL Database daily backup via Scheduled Tasks?

Adam12345

New Pleskian
Hello,

I'm new to Parallels Panel. I use version 11.0.9. I searched the forum and tutorials for a while but I couldn't find the exact solution. I want to backup mysql database daily. First of all, what is the best way for daily database backup in plesk. I'm trying to do this in Scheduled Tasks and I use mysqldump command although I'm not sure. Can you please tell me my mistakes?

I chose the time and day first and then I switched on the task. I typed the following command to
Command line.

mysqldump -uusername -ppassword databasename | gzip -9 >/httpdocs/mydatabase.sql.gz
or
mysqldump -uusername -ppassword databasename >/httpdocs/mydatabase.sql.gz

This created only a blank file. When I use this without gzip, nothing changes.

1- Is mysqldump right command for database backup?
2- Should I define full path for mysqldump, gzip and database? If so, how can I find out the full path of mysqldump, gzip and my database? Because I can't see their locations in panel.
3- I can't see any error message. There is not any log file in httpdocs folder. Where does the log file exist?
4- It is weird but should the username be "database user" or should I write "root" ?

Thank you.
 
You should use following command

/usr/bin/mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` databasename | gzip -9 > /path/databasename.sql.gz
 
Hi Igor, thanks for your reply. I tried the following commands but they didn't work. They only created blank backup files 0 kb sized.

/usr/bin/mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` mydatabasename | gzip -9 > /httpdocs/mydatabasename.sql.gz

/usr/bin/mysqldump -uroot -p`cat /etc/psa/.psa.shadow` mydatabasename | gzip -9 > /httpdocs/mydatabasename.sql.gz

/usr/bin/mysqldump -udatabaseusername -p`cat /etc/psa/.psa.shadow` mydatabasename | gzip -9 > /httpdocs/mydatabasename.sql.gz

I think the directory structure is different. Is that true? There is no bin folder under usr. The bin folder exists in the root and there are only the following files under bin folder :

bash 792 KB
cat 32.0 KB
cp 80.0 KB
du 76.0 KB
false 24.0 KB
grep 96.0 KB
groups 8.00 KB
head 36.0 KB
id 32.0 KB
less 152 KB
ln 36.0 KB
ls 100 KB
mkdir 36.0 KB
more 40.0 KB
mv 88.0 KB
pwd 32.0 KB
rm 52.0 KB
rmdir 28.0 KB
scp 64.0 KB
sh 792 KB
tail 48.0 KB
touch 48.0 KB
true 24.0 KB
vi

And there is no cat /etc/psa/.psa.shadow folders and files. There is a folder named etc in the root directory and there is a file named passwd in it.

How can I access all file and directory structure including hiddens?
How can I learn the full path of mysql database?
 
Back
Top