Comparing two tar files on AIX

Hello,

I have a directory which suddenly got filled up 100% from 70% ; (this is an oracle directory which has application and database in it ORACLE EBS)

I do make cold backups, last month when I made cold backup of the directory /oratec the tar zip file was 31GB and this month when i made the backup it was 42GB

an increase of 10GB in the zip/tar compressed file.

How can I find by comparing the two tar files which file or folder has

  1. changed in size
  2. size of all the folders
  3. size of large files

thanks

Running tar tvzf tarfile.tgz will give you date and size of the respective files; at least a first evidence for file changes.

thanks RudiC , but the data is composed of 270 GB so imagine the number of files and directories.

Anyway to compare two tar files ?

Use what RudiC wrote and redirect output to a file each and compare them with diff ? Or maybe use cksum on the archive files.

Yes, but only if you use GNU-tar, because the standard AIX-tar doesn't understand the "-z" (decompress from zip-compressed format) option. I suggest to use

gzip -cd /path/to.tar.gz | tar -tf -

instead which will work with GNU-tar and any standard-tar alike.

The "-t" option RudiC suggested only lists the names and sizes of the files, not the files themselves. The output depends on how many files there are but typical database-files are a few and big. Furthermore, you do not need to compare the different outputs by hand, use the "diff" tool as suggested by zaxxon.

Another option would be to use "find" to get the creation time, see "man find", seaching for "ctime".

I hope this helps.

bakunin

The following works in bash and zsh:

diff <(gzip -cd file1.tar.gz | tar tvf -) <(gzip -cd file2.tar.gz | tar tvf -)

(ksh works, too, but I get notifiers from bg processes.)
Make a script or function!
Example:

tarzdiff() {
 diff <(gzip -cd "$1" | tar tvf -) <(gzip -cd "$2" | tar tvf -)
}
tarzdiff file1.tar.gz file2.tar.gz
1 Like