3

I'm using zip to create an incremental archive.

I would like it to only echo the file if there was a change between source and the archive, or if it's an added file.

This would mean if I ran it twice in a row it would echo no files. (easy detection of changes is the point).

Is this possible?

Right now it echoes for every file, even if there has been no change.

I am using this command:

zip -r --test "Dest.zip" ./Source
muru
  • 197,895
  • 55
  • 485
  • 740
SimplGy
  • 133
  • 4

1 Answers1

3

What you probably want is to update the zip file:

update (-u): Update existing entries if newer on the file system and add new files. If the archive does not exist issue warning then create a new archive.

Therefore, you should try

zip -ru "Dest.zip" ./Source
halirutan
  • 264
  • Awesome. I didn't realize "add mode", the default, was adding no matter which version was newer. – SimplGy Dec 26 '14 at 04:06