Automatically backup MySQL database

I needed to backup a couple of MySQL databaes automatically. Here is what I did to accomplish this.

I created a folder called mysqlbackup. I then created a script called “mysqldbbackup.sh” and put this script file in the mysqlbackup folder.

It contains “rm /mysqlbackup/DBNAME_backup.sql
mysqldump -u USERNAME -pPASSWORD DBNAME > /mysqlbackup/DBNAME_backup.sql

I used the “rm” command to remove the last database backup before the new ...

Read More