Open a file backup.sh and add the following lines in the file. Change UserName and Password with actual Username and Password.
/usr/local/mysql/bin/mysqldump --user=UserName --password=Password --lock-all-tables --all-databases | gzip > /home/user/backup/mysql/backup.sql.gz cd /home/user/backup/mysql/ CURR=`date +%Y%m%d` mv backup.sql.gz archives/backup.sql.gz.$CURR
This script create the file in archives folder in a gzip format.
Leave a comment