difference in size of the tarred files after archiving using tar command

May 17th, 2011 - 05:59 am ET by Sooraj S | Report spam
Hi,

i am using red hat linux 2.4 . I have 3 folders dir1 dir2 dir3

I have tarred them like this.
1.tar cvfz tarball_1.tgz dir1 dir2 dir3
2.tar cvfz tarball_2.tgz dir1 dir2 dir3 2>& /dev/null (So that it does
not display any error message or operation details to the user)

[usr@machine]$ ls -lrt
-rw-r--r-- 1 usr grp 199843988 May 17 13:39 tarball_1.tgz
-rw-r--r-- 1 usr grp 199837488 May 17 13:53 tarball_2.tgz

But can any one explain the size difference as seen in list output...
email Follow the discussionReplies 2 repliesReplies Make a reply

Replies

#1 Jan Gerrit Kootstra
May 17th, 2011 - 02:18 pm ET | Report spam
Op 17-05-11 11:59, Sooraj S schreef:
Hi,

i am using red hat linux 2.4 . I have 3 folders dir1 dir2 dir3

I have tarred them like this.
1.tar cvfz tarball_1.tgz dir1 dir2 dir3
2.tar cvfz tarball_2.tgz dir1 dir2 dir3 2>& /dev/null (So that it does
not display any error message or operation details to the user)

[]$ ls -lrt
-rw-r--r-- 1 usr grp 199843988 May 17 13:39 tarball_1.tgz
-rw-r--r-- 1 usr grp 199837488 May 17 13:53 tarball_2.tgz

But can any one explain the size difference as seen in list output...



Sooraj,


I do not know what happend to the directories in the 14 minutes between
the two tar actions.


Please try to create tarballs with one commandline, so changes by a
process or a user are less likely.


tar cvfz tarball_1.tgz dir1 dir2 dir3 ; \
tar cvfz tarball_2.tgz dir1 dir2 dir3 2> /dev/null

Be aware that you made a type error 2>& should either be 2> or 2>&1>

Kind regards,


Jan Gerrit Kootstra

Similar topics