help-tar
[Top][All Lists]
Advanced

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

Re: Taking inremental snapshot from different source directories


From: Sergey Poznyakoff
Subject: Re: Taking inremental snapshot from different source directories
Date: Mon, 19 Jun 2023 19:43:15 +0200
User-agent: MH (GNU Mailutils 3.15)

Hi Yakul,

Incremental archives cannot be created from different source directories.

> intended bahaviour would be that archive1.tar.gz should container only
> 'testfile'. But it is taking the archive of all the contents.

You extract from your archive before creating second archive.  This
changes inode numbers of all files, so they all look new to the second
tar invocation (snapshot file records device and inode numbers; a file
is considered new if its device/inode pair is not found in the
snapshot).

> Any pointers would be helpful

Two important points.  First, remove your extraction attempt.  It serves
no purpose anyways, except for clobbering inode numbers.

Secondly, don't reuse the snapshot file in the subsequent attempt.  You
might need it later.  Instead of

> echo "Taking second snapshot"
> tar -z --create --file archive1.tar.gz \
>     --listed-incremental=/home/yakul/snapshot.file --same-owner ...

do this:

  echo "Taking second snapshot"
  cp /home/yakul/snapshot.file /home/yakul/snapshot1.file
  tar -z --create --file archive1.tar.gz \
      --listed-incremental=/home/yakul/snapshot1.file --same-owner ...

Regards,
Sergey



reply via email to

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