Avatar of Alan
Alan
Flag for New Zealand

asked on 

Linux - Zip - How to update all changes without re-building entirely

Hi All,

I am trying to get 'zip' to update all changes without having to re-build (re-compress) all the files that have not changed.

I am running this on Ubuntu Server 18.04 LTS, but I doubt that changes anything.

The base command I am using is:

zip -r9 /mnt/Path/Backups/Drive1.zip /media/Drive1/Files/

Open in new window

This works fine and zips up all the files into Drive1.zip.

However, when I run this next time, I would like it to not have to re-compress all the files, but rather just add new files, update any files that have changed, and delete files that no longer exist.

So I tried this:

zip -f -u -r9 /mnt/Backups/Drive1.zip /media/Drive1/Files/

Open in new window

However, it does not seem to actually delete files that no longer exist, and the zip archive just grows slowly but surely over time.

What am I missing?

I could just delete the previous Drive1.zip and re-create each time, but that will be much slower I think.


Thanks,

Alan.
LinuxUbuntuLinux OS DevLinux Distributions

Avatar of undefined
Last Comment
Alan

8/22/2022 - Mon