[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-tar] Merge incremental backups created by tar -g

From: Sergey Poznyakoff
Subject: Re: [Help-tar] Merge incremental backups created by tar -g
Date: Sat, 26 May 2012 17:15:26 +0300

CUI Hao <address@hidden> ha escrit:

> As time goes by, a lot of archives is made. I want to merge some old
> backups to one archive.
> I simply tried to restore old ones and re-archive them:
>    tar -g testbk -xvpf test0.tar test
>    tar -g testbk -xvpf test1.tar test

Yes, that's right.

>    tar -g testbk -cvpf test01.tar test

And that's not. You use old snapshot file here (testbk) and that
instructs tar to archive only those files that have changed since this
file was created. For example, if nothing has changed, the test01.tar
will be effectively empty (it will contain only the directory structure,
not files). This is hardly what you need.

To create a full backup you should start with a clean snapshot file, i.e.:

    > testbk  
    tar -g testbk -cvpf test01.tar test

If you use tar version 1.23 or later, you can use the --level=0 option
for that, e.g.:

    tar -g testbk --level=0 -cvpf test01.tar test

It will clear the contents of testbk prior to archiving, just as the
shell command "> testbk" does.

> As I am not sure about the content of data file (testbk in above
> example),

A snapshot file preserves the state of the file system at the moment when
the archive was created.  In general, wherever you start a full dump you
should clear it, using one of the methods above.  In contrast, if you do
an incremental dump, use the snapshot file created previously.

When listing or extracting, snapshot file is not used, but it is
required syntactically (because the -g option requires an argument).  It
is a common practice to use /dev/null in these cases, e.g.:

    tar -g /dev/null -xvpf test0.tar test


reply via email to

[Prev in Thread] Current Thread [Next in Thread]