Hi Sergey, Thanks for the reply. Unfortunately, in my case, the source directory whose snapshot I want to take is changing and there is no workaround for that. But since I am passing --no-check-device, shouldn't the invocation ignore the inode attribute of the files when checking for modified files?
On Mon, Jun 19, 2023 at 11:13 PM Sergey Poznyakoff <[email protected]> wrote: > 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 > -- Regards, *Yakul Garg* *Contact: +91-816-725-2222**Linkedin <https://www.linkedin.com/in/yakul-garg-32184391/>*
