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
<https://www.linkedin.com/in/yakul-garg-32184391/>*

Reply via email to