Backup mysql database
First of all run this command
nano ~/.my.cnf
and write bellow codes
[mysqldump]
user=root
password=mypassword
after that create bkp.sh file in home directory
in bkp.sh file write below codes
mysqldump -u root db_name>db_name.sql
now open crontab and create a new job for backup to database
open crontab for this run below command
crontab -e
and create a new line
00 2 * * * /home/bkp/bkp.sh
and save this (ctrl+x and enter)
Comments
Post a Comment
If you any doubt of any topic then you can comment me.