0

I want to compare catalog with compressed without extracting or compress files and compare. Is there any way to compare directory with compressed directory ?

Example: I have some files in tmpfs (ramdisk), before server shutdown, I need to save files to disk. In my opinion best way is compress files and save to disk like a file. On start server (system) I want to decompress files in to the ramdisk. But after couple days ramdisk files will be updated (different with compress file backup).

How to compare and merge diff ?

Regards, Nerus.

Nerus
  • 167
  • 1
  • 2
  • 13

1 Answers1

1

Executing:

tar -tvf foo.tar.gz

will show the contents of the compressed file without decompressing. You can then compare the files.

AwkMan
  • 670
  • 6
  • 18
  • I'll use 'tar -df ramdisk.tar.bz2 -C /'. how to replace different files from directory in compressed file, how to create automated merge ? – Nerus Jul 26 '16 at 15:36
  • @Nerus With the -u parameter of tar, it should update only the new files in the compressed files. I have not tried it before, so I cannot give you more advice. – AwkMan Jul 27 '16 at 09:45