If I have the following zip:
my.zip
|- folder
| `- to-update.txt
`- some-other-file.txt
and a folder structure:
working-directory
`- folder
`- to-update.txt
I wish to copy the file to-update.txt
from my working directory into the zip. To do that I would use:
# Currently in working-directory
zip -ru /path/to/my.zip .
However, if my.zip
's copy of to-update.txt
is newer, this will not work and zip outputs (with -v
):
zip diagnostic:
folder/
up to date
zip diagnostic:folder/to-update.txt
up to date
How can I get it to overwrite any files (and still add new ones) from my filesystem/working directory even if they have an older timestamp?
Unlike the file-sync option, I do not want to remove missing files, so some-other-file.txt
should remain untouched.
zip my.zip Folder/to-update.txt
do what you want? In my test it does.folder
or even inworking-directory
.zip -r my.zip folder/