Is there a way to update zip files automatically?

When updating a zip file with option -u it will update/freshen any file that has changed, add any file that has been added BUT it will not delete any file that is not in the source tree any more.

I suppose this is intentional to make it possible to start from a tree that only contains added/changed files.

But is there still one option to enable this with some trick that will save me time, since I'm working with very big zip files, compared to new zip generation from scratch?

Thanks in advance,

tent:wq

1 Answer

I found the option I was looking for in the man page finally:

-FS (or --filesync)!

So for instance:

zip -FS9ryo archive.zip directory_to_compress/*

will completely sync -FS what is in folder "directory_to_compress" with the archive.zip file (no matter if you created, deleted or updated files in that dir); it will compress with maximum compression level -9; it will recurse into sub-directories -r; store symlinks as is and not as referenced file and set the date of the zip archive to the latest file in dir -o.

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like