Friday, November 26, 2010

Tpo 100 Książki



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 / backups

1.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 / mysql

mysqldump-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-e

4.2

We put in the file 01 01 * * * / etc / init.d / respaldomysql.sh> / dev / null 2> / dev / null Save and 4.3

ready

cron
The parameters are: Minutes (0 - 59) Month (1 - 12)
Day of week (0 - 6 0 = Sunday)
path to the script or program you want to run
In section 4.2 for example is the backup to 1:01 am on all days, weeks and months


0 comments:

Post a Comment