Hello Friends
With the purpose to do a correct backup for the LiveDemo directory (any name as you want) consider the following directory structure:
/home/you/LiveDemo
aaa
bbb
ccc
.git
Where:
- The
aaa,bbbandcccare directories - The
.gitis a hidden directory
The following command was executed within the same LiveDemo directory:
tar -czf LiveDemo.tar.gz *
It works but I did do realize that when it is unpacked with the following command (in other machine) :
tar -xzf LiveDemo.tar.gz
Does not appear the .git directory. Therefore as follows:
/home/you/LiveDemo
aaa
bbb
ccc
It is confuse because (if I am not mistaken) for the following different directory structure each .git hidden directory appears.
/home/you/Cybertron
alpha
.git
beta
.git
gamma
. git
Therefore
- It seems that the
tar -czf backup.tar.gz *command âdoes not work wellâ by ignoring (or not including) any hidden content available at the same level where it is executed. Pls correct me if I am wrong.
After to did do a research in the Web the following command was executed instead (again within the same LiveDemo directory):
tar -czf LiveDemo.tar.gz .
As you can see was changed from * to . but generates the following situations:
One
The LiveDemo.tar.gz file is created but appears the following message
tar: ./LiveDemo.tar.gz: file changed as we read it
tar: .: file changed as we read it
Two
The LiveDemo.tar.gz file has a size of 2.4MB but when it is unpacked in other machine the original size changes to a size of 1MB
Therefore in other words:
- The
LiveDemo.tar.gzfile is copied (from pendrive) and pasted (to target machine) - The
LiveDemo.tar.gzfile has a size of 2.4MB (as the pendrive because it is a simple copy) - The
tar -xzf LiveDemo.tar.gzcommand is executed - Appears the unpacked content (including finally the
.githidden directory) - The
LiveDemo.tar.gzremains in the target directory - The
LiveDemo.tar.gzhas a new size of 1MB
Questions
- What does the Oneâs message mean?
- Should I do something to fix it? Or simply ignore it?
- Why the
LiveDemo.tar.gzfile changed its size after when it is unpacked?
Thanks in advance