Linux使用 tar命令-g參數進行增量+差異備份、還原檔案

來源:互聯網
上載者:User

標籤:blog   內容   完整備份   lin   增量   http   參數   hpc   log   

原文連結:http://www.cnblogs.com/gnuhpc/

完整備份:

建立測試路徑與檔案

mkdir testtouch test/{a,b,c}

在test下產生三個檔案

執行完整備份

tar -g snapshot -zcf backup_full.tar.gz test

查看 tarball 內容

tar ztf backup_full.tar.gztest/test/atest/btest/c

差異+增量備份 :

新增一個檔案, 並修改一個檔案內容

touch test/eecho 123 > test/a

執行第二次的增量備份 (注意 tarball 檔名)

tar -g snapshot -zcf backup_incremental_2.tar.gz test

查看 tarball 內容

tar ztf backup_incremental_2.tar.gztest/test/atest/e

還原備份資料:

清空測試資料

rm -rf test

開始進行資料還原

tar zxf backup_full.tar.gztar zxf backup_incremental_1.tar.gztar zxf backup_incremental_2.tar.gz

查看測試資料

ls testa b c d e

到此結束
另外,還有稍微複雜點兒的
http://blog.sina.com.cn/s/blog_4ac65f6f0100d4vu.html

http://seanlook.com/2014/12/08/tar_backup_filesystem/

Linux使用 tar命令-g參數進行增量+差異備份、還原檔案

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.