每三小時熱備shell指令檔

來源:互聯網
上載者:User

mysql1# cat mysqlbackup.sh
#!/usr/local/bin/fish

#備份策略為每天全備

#設定備份路徑變數

set backupdir /usr/db/backup

#產生備份目錄

mkdir -p $backupdir

#刪除備份時間超過一個月的備份

find $backupdir/ -mtime +30 -type d -delete

#開始備份

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 00:02 2013-03-01_00-01-08
drwxr-xr-x  8 root  wheel  512 Mar  1 03:03 2013-03-01_03-01-26
drwxr-xr-x  8 root  wheel  512 Mar  1 06:02 2013-03-01_06-01-09
drwxr-xr-x  8 root  wheel  512 Mar  1 09:02 2013-03-01_09-01-14
drwxr-xr-x  8 root  wheel  512 Mar  1 12:02 2013-03-01_12-01-20
drwxr-xr-x  8 root  wheel  512 Mar  1 15:02 2013-03-01_15-01-23
drwxr-xr-x  8 root  wheel  512 Mar  1 18:02 2013-03-01_18-01-21
drwxr-xr-x  8 root  wheel  512 Mar  1 21:02 2013-03-01_21-01-21
drwxr-xr-x  8 root  wheel  512 Mar  2 00:03 2013-03-02_00-01-22
drwxr-xr-x  8 root  wheel  512 Mar  2 03:03 2013-03-02_03-01-24
drwxr-xr-x  8 root  wheel  512 Mar  2 06:02 2013-03-02_06-01-10
drwxr-xr-x  8 root  wheel  512 Mar  2 09:03 2013-03-02_09-01-23
drwxr-xr-x  8 root  wheel  512 Mar  2 12:02 2013-03-02_12-01-19
drwxr-xr-x  8 root  wheel  512 Mar  2 15:02 2013-03-02_15-01-17
drwxr-xr-x  8 root  wheel  512 Mar  2 18:02 2013-03-02_18-01-13
drwxr-xr-x  8 root  wheel  512 Mar  2 21:03 2013-03-02_21-01-16
drwxr-xr-x  8 root  wheel  512 Mar  3 00:02 2013-03-03_00-01-14
drwxr-xr-x  8 root  wheel  512 Mar  3 03:03 2013-03-03_03-01-26
drwxr-xr-x  8 root  wheel  512 Mar  3 06:02 2013-03-03_06-01-09
drwxr-xr-x  8 root  wheel  512 Mar  3 09:02 2013-03-03_09-01-18
drwxr-xr-x  8 root  wheel  512 Mar  3 12:02 2013-03-03_12-01-12
drwxr-xr-x  8 root  wheel  512 Mar  3 15:02 2013-03-03_15-01-19
drwxr-xr-x  8 root  wheel  512 Mar  3 18:02 2013-03-03_18-01-21
drwxr-xr-x  8 root  wheel  512 Mar  3 21:03 2013-03-03_21-01-23
drwxr-xr-x  8 root  wheel  512 Mar  4 00:02 2013-03-04_00-01-21
drwxr-xr-x  8 root  wheel  512 Mar  4 03:03 2013-03-04_03-01-24
drwxr-xr-x  8 root  wheel  512 Mar  4 06:02 2013-03-04_06-01-09
drwxr-xr-x  8 root  wheel  512 Mar  4 09:02 2013-03-04_09-01-16
drwxr-xr-x  8 root  wheel  512 Mar  4 12:02 2013-03-04_12-01-12
drwxr-xr-x  8 root  wheel  512 Mar  4 15:02 2013-03-04_15-01-22
drwxr-xr-x  8 root  wheel  512 Mar  4 18:02 2013-03-04_18-01-23
drwxr-xr-x  8 root  wheel  512 Mar  4 21:02 2013-03-04_21-01-23
drwxr-xr-x  8 root  wheel  512 Mar  5 00:02 2013-03-05_00-01-22
drwxr-xr-x  8 root  wheel  512 Mar  5 03:03 2013-03-05_03-01-27
drwxr-xr-x  8 root  wheel  512 Mar  5 06:02 2013-03-05_06-01-11
drwxr-xr-x  8 root  wheel  512 Mar  5 09:02 2013-03-05_09-01-25
drwxr-xr-x  8 root  wheel  512 Mar  5 12:02 2013-03-05_12-01-23
drwxr-xr-x  8 root  wheel  512 Mar  5 15:02 2013-03-05_15-01-23
drwxr-xr-x  8 root  wheel  512 Mar  5 18:02 2013-03-05_18-01-25
drwxr-xr-x  8 root  wheel  512 Mar  5 21:02 2013-03-05_21-01-22
drwxr-xr-x  8 root  wheel  512 Mar  6 00:03 2013-03-06_00-01-26
drwxr-xr-x  8 root  wheel  512 Mar  6 03:03 2013-03-06_03-01-26
drwxr-xr-x  8 root  wheel  512 Mar  6 06:02 2013-03-06_06-01-09
drwxr-xr-x  8 root  wheel  512 Mar  6 09:03 2013-03-06_09-01-23
drwxr-xr-x  8 root  wheel  512 Mar  6 12:03 2013-03-06_12-01-24

...................................................................................................................

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.