MySQL backup
In this post, I'll setup an automatic backup script that create an sql compressed with bz2 file per database. sudo -s Autologin with MySQL : sudo -s vi /root/.my.cnf [client] user=root password=TheRootPassword protocol=tcp chmod 400 /root/.my.cnf Test : [root@dell1 ~]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 870724 to server version: 4.1.22 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> quit Bye [root@dell1 ~]# Script vi /root/scripts/cron/backupDatabaseJob.sh #!/bin/bash TIME=`date` echo "Starting MySQL Backup at $TIME" BACKUPLOCATION=/home/backup/databases CURRENTDATE=`date +%Y%m%d` CURRENTLOCATION=$BACKUPLOCATION/MySQL_$CURRENTDATE if [ ! -d $BACKUPLOCATION ] then echo "create directory for database saves $BACKUPLOCATION" mkdir $BACKUPLOCATION fi echo "Databases saves at $CURRENTLOCATION"; mkdir -p $CURRENTLOCATION mysql --def...