0

[Using Terminal on Mac/Sonoma] I zip my working directory with zip -u archive dir when ending a work session. dir is located on an external USB drive, archive on another external USB drive. I accidentally deleted myfile in the working dir and tried to restore it.

The file was zipped twice: on Jan 7 and a modified version on Feb 24. Every attempt to unzip the Feb 24 version retrieved the Jan 7 version instead. I verified that both versions are present in archive with unzip -l archive.

Attempts that failed:

unzip archive myfile

unzip -n archive myfile and unzip -u archive myfile: would it extract Jan 7 and then overwrite with Feb 24--NO

Could I somehow limit the timestamp? NO: info unzip did not reveal any option that would do this.

Before you ask, Yes, Time Machine was Plan A. Being VERY paranoid, however I always TM AND zip my work. For unknown reasons not relevant to this query, the second drive was not backed up, so on to Plan B (zip). Plan C is to recreate as much as I can of myfile (90% if I'm lucky and two days' work), but obviously I would really, really like to make Plan B work. Thanks in advance if you can help.

1 Answer 1

0

The disk on which archive resides and/or archive itself is defective.

I discovered this when I attempted to save archive on another disk for further study but cp errored "target disk not big enough" even though the file manager sized it at 4.29G and the target was an empty 64G thumb. Disk utility cannot erase the USB drive containing the archive and it had to be discarded.

I have used zip -ru previously and on one occasion several years ago after many saves, the archive became corrupted (the disk was reusable), so I suspect that zip has an upper limit which, when exceeded, causes zip metadata to be overwritten. I had forgotten this incident but I have now modified my end-of-evening procedure to create a fresh archive each time so that I won't be burned a third time.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .