News:

OS2World.com Forum is back !!!

Remember to visit OS2World at:
http://www.os2world.com

Main Menu

backup and restore using zip

Started by Neil Waldhauer, October 20, 2017, 04:20:31 AM

Previous topic - Next topic

Neil Waldhauer

For years, well really decades, I've used zip and unzip to backup and restore bootable volumes.

Now with ArcaOS, it doesn't work.

I use zip -qrS to backup and unzip to restore.

Now that doesn't work because \usr is full of symbolic links that get replaced by files.

This make rpm/yum stop working.

Does anyone have an alternative, or better options for zip that backup and restore symbolic links?
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Dave Yeo

Quickly testing, 7z seems to preserve symlinks. You might want to test.

Doug Bissett

I use -9yrS. -y is supposed to handle symlinks as a standard file. That part seems to work, although I haven't tested everything.

Right now, I am concerned because -S (include system and hidden files) isn't doing what it says it is supposed to do. As a work around, I do ATTRIB -H -S os2* in the root of the boot drive before ZIP, and  (optionally) ATTRIB +H +S os2* again after. There are a few other SH files, but they are nothing to worry about.

FWIW, I have formatted a boot drive, and UNZIPed a backup into it, many times. It always worked, until -S quit working. By using ATTRIB, it works again.

I have also been looking at 7z as an alternative. It compresses better, and I copy the backups to USB sticks, which seem to be getting smaller, and slower, as time goes on.  :(

Neil Waldhauer

How does 7z work for drive letters? For example the following backs up the C: drive using zip.

zip -qryS drivec.zip c:

The following does nearly nothing.

7z a drivec.7z c:

What is the 7z command to back up the whole drive? (and why isn't it documented in the p7zip package?)
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Andreas Schnellbacher

Quote from: Neil Waldhauer on October 20, 2017, 10:39:26 AM
How does 7z work for drive letters? For example the following backs up the C: drive using zip.

zip -qryS drivec.zip c:

The following does nearly nothing.

7z a drivec.7z c:
Without being able to test: I guess that 'c:' matches no folder or file. I would try 'c:\' or 'c:\*' next.

ivan

7zip does things in its own way which isn't the way we are used to.

Good luck making heads or tails out of that for anything more complicated than compressing a few files for storage.

A manual for the command line version we have appears at https://info.nrao.edu/computing/guide/file-access-and-archiving/7zip/7z-7za-command-line-guide


Neil Waldhauer

Quote from: Andreas Schnellbacher on October 20, 2017, 10:50:33 AM
Quote from: Neil Waldhauer on October 20, 2017, 10:39:26 AM
How does 7z work for drive letters? For example the following backs up the C: drive using zip.

zip -qryS drivec.zip c:

The following does nearly nothing.

7z a drivec.7z c:
Without being able to test: I guess that 'c:' matches no folder or file. I would try 'c:\' or 'c:\*' next.

Why can't you test?

As long as the c: drive exists, c: may refer to the root. I suspect there isn't really full drive letter support in 7z.

None of the suggestions work. The following works, but I'm still curious how to do it in one line.

c:
cd \
7z a d:ArcaOS-C.7z \

It's not important to the conversation about how 7z syntax works, but 7z is a better compressor.

ArcaOS-C.zip 1,785,138,333 bytes
ArcaOS-C.7z 1,283,110,828 bytes

The number of files is not consistent between the two archives. I don't know why.
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Andreas Schnellbacher

Quote from: Neil Waldhauer on October 20, 2017, 04:08:21 PM
Why can't you test?
I'm now back at home.

Quote from: Neil Waldhauer on October 20, 2017, 04:08:21 PM
I suspect there isn't really full drive letter support in 7z.
Indeed. Drive specs were simply ignored. Moreover, forward slashes have to be used. This doesn't work:

e:
cd \var
7z a drivee.7z \


This works:

e:
cd \var
7z a drivee.7z /


This works as well:

e:
cd \var
7z a drivee.7z /*


That looks like a bug.


Neil Waldhauer

From my testing zip 3.0

zip -qryS drivec.zip c:

does make a good backup that works with symlinks (i.e. yum still works after restore)

A restore of the backup I did with 7z does not work; it cannot find the desktop. The desktop seems to be restored, but ArcaOS can't use it.
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Doug Bissett

Quotezip -qryS drivec.zip c:

does make a good backup that works with symlinks (i.e. yum still works after restore)

Be aware, that ZIP and UNZIP,  as supplied by RPM/YUM, don't work without some of the DLLs from the %UNIXROOT% directory structure. You do need those versions of the program, to be able to handle files (in and/or out) that are larger than 2 GB.