I want to take backup of my database daily with cPanel
cron job
I’ve tried this solutions but didn’t work for me
mysqldump -uCpenelUsername -pCpanelPassword dbname > testDB/$(date +%m-%d-%Y-%H.%M.%S)-name.sql
Can someone please guide me where I’m making a mistake
2
Answers
This command works perfect for me
date=`date -I`; mysqldump -u cPanelusername -pcPanelpassword dbname > /home/cPanelusername/testDB/xbackup_$date.sql
Make sure you are using your sudo user name sudo DB password, which is the root DB password, without that you cant export, next is the path, use something like this,