Mysql1 # Cat mysqlbackup. Sh
#! /Usr/local/bin/fish
# The backup policy is daily full backup
# Setting backup path variables
Set backupdir/usr/DB/backup
# Generate a backup directory
Mkdir-p $ backupdir
# Delete a backup that has been backed up for more than one month
Find $ backupdir/-mtime + 30-type D-delete
# Start backup
Innobackupex -- user = root -- Password = 'yue5bkgof $ '-- Parallel = 12 $ backupdir/
Mysql1 # cd/usr/DB/backup/
Mysql1 #
Mysql1 # ll
Total 442
Drwxr-XR-x 8 root wheel 512 Mar 1 2013-03-0000000-01-08
Drwxr-XR-x 8 root wheel 512 Mar 1
Drwxr-XR-x 8 root wheel 512 Mar 1 2013-03-06-01-09
Drwxr-XR-x 8 root wheel 512 Mar 1 2013-03-051109-01-14
Drwxr-XR-x 8 root wheel 512 Mar 1
Drwxr-XR-x 8 root wheel 512 Mar 1 2013-03-0%15-01-23
Drwxr-XR-x 8 root wheel 512 Mar 1 2013-03-051118-01-21
Drwxr-XR-x 8 root wheel 512 Mar 1
Drwxr-XR-x 8 root wheel 512 Mar 2 2013-03-02_00-01-22
Drwxr-XR-x 8 root wheel 512 Mar 2 2013-03-02_03-01-24
Drwxr-XR-x 8 root wheel 512 Mar 2 2013-03-02_06-01-10
Drwxr-XR-x 8 root wheel 512 Mar 2 2013-03-02_09-01-23
Drwxr-XR-x 8 root wheel 512 Mar 2 2013-03-02_12-01-19
Drwxr-XR-x 8 root wheel 512 Mar 2 2013-03-02_15-01-17
Drwxr-XR-x 8 root wheel 512 Mar 2 2013-03-02_18-01-13
Drwxr-XR-x 8 root wheel 512 Mar 2 2013-03-02_21-01-16
Drwxr-XR-x 8 root wheel 512 Mar 3 2013-03-03_00-01-14
Drwxr-XR-x 8 root wheel 512 Mar 3 2013-03-03_03-01-26
Drwxr-XR-x 8 root wheel 512 Mar 3 2013-03-03_06-01-09
Drwxr-XR-x 8 root wheel 512 Mar 3 2013-03-03_09-01-18
Drwxr-XR-x 8 root wheel 512 Mar 3 2013-03-03_12-01-12
Drwxr-XR-x 8 root wheel 512 Mar 3 2013-03-03_15-01-19
Drwxr-XR-x 8 root wheel 512 Mar 3 2013-03-03_18-01-21
Drwxr-XR-x 8 root wheel 512 Mar 3 2013-03-03_21-01-23
Drwxr-XR-x 8 root wheel 512 Mar 4 2013-03-04_00-01-21
Drwxr-XR-x 8 root wheel 512 Mar 4 2013-03-04_03-01-24
Drwxr-XR-x 8 root wheel 512 Mar 4 2013-03-04_06-01-09
Drwxr-XR-x 8 root wheel 512 Mar 4 2013-03-04_09-01-16
Drwxr-XR-x 8 root wheel 512 Mar 4 2013-03-04_12-01-12
Drwxr-XR-x 8 root wheel 512 Mar 4 2013-03-04_15-01-22
Drwxr-XR-x 8 root wheel 512 Mar 4 2013-03-04_18-01-23
Drwxr-XR-x 8 root wheel 512 Mar 4 2013-03-04_21-01-23
Drwxr-XR-x 8 root wheel 512 Mar 5 2013-03-05_00-01-22
Drwxr-XR-x 8 root wheel 512 Mar 5 03 2013-03-05_03-01-27
Drwxr-XR-x 8 root wheel 512 Mar 5 2013-03-05_06-01-11
Drwxr-XR-x 8 root wheel 512 Mar 5 2013-03-05_09-01-25
Drwxr-XR-x 8 root wheel 512 Mar 5 2013-03-05_12-01-23
Drwxr-XR-x 8 root wheel 512 Mar 5 2013-03-05_15-01-23
Drwxr-XR-x 8 root wheel 512 Mar 5 2013-03-05_18-01-25
Drwxr-XR-x 8 root wheel 512 Mar 5 2013-03-05_21-01-22
Drwxr-XR-x 8 root wheel 512 Mar 6 2013-03-06_00-01-26
Drwxr-XR-x 8 root wheel 512 Mar 6 2013-03-06_03-01-26
Drwxr-XR-x 8 root wheel 512 Mar 6 2013-03-06_06-01-09
Drwxr-XR-x 8 root wheel 512 Mar 6 2013-03-06_09-01-23
Drwxr-XR-x 8 root wheel 512 Mar 6 2013-03-06_12-01-24
........................................ ........................................ ...................................