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: Yakul Garg
Subject: Re: Taking inremental snapshot from different source directories
Date: Mon, 19 Jun 2023 01:07:03 +0530

I am using tar version 1.34




On Mon, Jun 19, 2023 at 1:01 AM Yakul Garg <2000yeshu@gmail.com> wrote:
I want to take incremental snapshot using the same level file
Below is a basic script to show what i want to do.

#!/bin/bash

rm archive.tar.gz archive1.tar.gz snapshot.file
rm -rf /tmp/app-streaming-microservices

echo "Taking first snapshot"
# this will take archive of app-streaming-microservices
tar -z --create --file archive.tar.gz \
--listed-incremental=/home/yakul/snapshot.file --same-owner --no-check-device \
--exclude node_modules \
-C app-streaming-microservices .

echo "Extracting file"
mkdir /tmp/app-streaming-microservices
tar -z --extract --file archive.tar.gz -C /tmp/app-streaming-microservices --same-owner --no-check-device --preserve-permissions

echo "Creating file in new source folder"
echo "hello" > /tmp/app-streaming-microservices/testfile

echo "Taking second snapshot"
tar -z --create --file archive1.tar.gz \
--listed-incremental=/home/yakul/snapshot.file --same-owner --preserve-permissions --no-check-device \
--exclude node_modules \
-C /tmp/app-streaming-microservices .


echo "First archive size"
du -h archive.tar.gz
echo "Second archive size"
du -h archive1.tar.gz

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

Any pointers would be helpful. Thanks.

--
Regards,
Yakul Garg
Contact: +91-816-725-2222
Linkedin



--
Regards,
Yakul Garg
Contact: +91-816-725-2222
Linkedin

reply via email to

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