Use tar incremental backup under Linux

Source: Internet
Author: User

Use tar incremental backup under Linux

Incremental backup experiment using the TAR-G parameter

Full backup:

#建立测试路径与档案
mkdir Kerryhu
Touch Kerryhu/{a,b,c}
Generate three files under Kerryhu

#执行完整备份
Tar-g KING-ZCVF kerryhu_full.tar.gz Kerryhu

Cat King

1270531376

#查看 tarball Content
TAR-ZTF kerryhu_full.tar.gz
kerryhu/
kerryhu/a
Kerryhu/b
Kerryhu/c

Incremental backup:

#新增一个档案
Touch kerryhu/d

#执行第一次的增量备份

Tar-g KING-ZCVF kerryhu_diff_1.tar.gz Kerryhu

#查看第一次增量备份的内容
TAR-ZTF kerryhu_diff_1.tar.gz
kerryhu/
kerryhu/d

#新增一个档案, and move a file content
Touch kerryhu/e
echo "Test" > kerryhu/a

#执行第二次的增量备份
Tar-g KING-ZCVF kerryhu_diff_2.tar.gz Kerryhu

Cat King

1270532463

#查看第二次增量备份的内容

TAR-ZTF kerryhu_diff_2.tar.gz
kerryhu/
kerryhu/a
kerryhu/e

Restore Backup data:

#清空测试资料
RM-RF #查看第一次增量备份的内容

#开始进行资料还原
TAR-ZXVF kerryhu_full.tar.gz
TAR-ZXVF kerryhu_diff_1.tar.gz
TAR-ZXVF kerryhu_diff_2.tar.gz

#查看测试资料
LS Kerryhu
A b c d E

Cat kerryhu/a

Test


This article from the "Savage Power" blog, declined to reprint!

Use tar incremental backup under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.