troubleshooting Question

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

Avatar of Alan
AlanFlag for New Zealand asked on
LinuxUbuntuLinux OS DevLinux Distributions
10 Comments2 Solutions15 ViewsLast Modified:
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/
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/
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.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros