Data is stored in / var / lib / mysql within this directory is the database we have, seen in folders, to support: 1. Compressed hot backup 1.1 Create a folder where the backups were created
# mkdir / home / backups1.2 launch # tar-zcpf / home / backup / mysql.tar.gz / var / lib / mysql Here we have a backup of all databases To check run the following to unzip the file mysql.tar.gz # tar-zxvf mysql.tar.gz
2. Hot backup with mysqldump sql 2.1 execute the following statement # mysqldump-u root-pclave base_datos> / home / backup / nombre_respaldo.sql 3. We above done by a command. sh create low 3.1 # cd / etc / init.d # nano respaldomysql.sh 3.2 enter two lines in the file and save
tar-zcpf / home / backup / mysql.tar . gz / var / lib / mysqlmysqldump-u root-pclave base_datos> / home / backup / nombre_respaldo.sql 3.3 Changes the permissions # chmod + x respaldomysql.sh 3.4 We ran with # / etc / init. d / respaldomysql.sh 4. Now as the OSCI of each day is greater than that of Monday, we leave it as a task to run automatically using cron execute
# 4.1 crontab-e4.2
We put in the file 01 01 * * * / etc / init.d / respaldomysql.sh> / dev / null 2> / dev / null Save and 4.3ready
cron
0 comments:
Post a Comment