Trying to use zoo, to archive a directory’s contents, including subdirectories. Can’t get it to work. It got some of the files. Does anyone know the commands to do this? There is also Archive.
I just saw your post, but it is midnight here. I will check on my QNX 2 system in the morning. I found this manual page:
https://manpages.ubuntu.com/manpages/xenial/en/man1/zoo.1.html
however it might be too new to be of use. The QNX archiver is probably 30+ years old. You might check using the QNX 2 convention to see if there is any documentation in the program:
zoo ?
So this is the documentation embedded in the program.
It does not seem to be able to archive a directory however the following two methods might work for you.
zoo a archive.zoo tmp/*
This will archive all the files in the tmp directory.
If you want to archive a multi-level directory, this seems to work
files -v tmp | zoo aI archive.zoo
With the I option, you can pass a list of filenames via stdin.
And if for some strange reason, you need a consultant who knows QNX 2, you know where to find me,
Thanks M. Yes I’ve come across these and the manual pages. I went straight for “H”. Problem is, just hard to translate. Wish I could find the “Great QNX Book of Examples”.
I’ve mentioned you many times to the boss.
The first one works, except it only gives me 8 of the more than 8 files, (I phrase this way because “|more” won’t function). The second one gives me a pipe error “unable to open” and “Incorrect number of arguments”. You know this is a damaged drive. That’s why I’m trying to get the files off it. Probably the reason things don’t go right. Just for fun I’m going to try a healthy drive.
I think that there is a privately written QNX 2 book on my shelf. I don’t know how it is for examples.
Is there any way to generate a list of empty directories?
between files and ls, I wasn’t quite confident either would be able to accomplish this in simple fashion… I have a friend who lives in the linux world glance at the command options/usage (as well as the qnx commands manual), and he wondered if the eo and ws functions might be able to help build a little sequence or routine.
is this a situation where I might have to get creative (and actually know what I’m doing) and make a script or something to output a list of empty directories?
Our software sometimes expects certain directories to exist even if they may be empty, and it can cause issues if they aren’t there.
Context:
This thread was started by my coworker who retired earlier this year, and he was previously the person who maintained these systems to the best of his ability.
In my time of taking over, I think I’ve surpassed his knowledge/capacity for navigating qnx in the background and utilizing some of its functions for various goals.
Coincidentally, I have just successfully used the zoo command to make a single-file archive of an entire established system.
It really was this simple, despite the wordsalad of the help functions within the command. I added “P” to “pack” the archive as I do not intend to make use of its generational backup function.
But there’s still a caveat with using this utility… according to that old manual,
It saves full pathnames, and has the ability to create destination directories during extraction, all of which are Good Things… but I need those empty directories, too.
I’m pretty sure that this won’t help, but it would be a simple program to run throught the file structure and report any directories that are empty. You would need a compiler and a little bit of knowledge on how to program this.
what about a slightly more manual approach? Maybe I don’t necessarily need something that can discern empty directories…
if I were to enter
files +d -v
that gives me an entire list of only directory structure, without any header or superfluous info…
If I export that output to a file, could I then feed that into the mkdir command to have mkdir create all those directories? I just tried piping it into mkdir and it returned an error…
I know some commands can’t take piped input, would there be a way to make a little script that parses the files output and then just inserts "mkdir " in front of every line item and executes line by line or something like that?
The zoo command has an option " / " which extracts the archive to subdirectories (a double slash // “creates subdirectories as needed,”)… so if I could automate the process of making all the directories in advance, I could just have the zoo extraction put files where they need to go…
Alternatively I could do
dir +c -f
and make note of all directories with a (0) tally and then manually re-create those whenever restoring an archive… but that’s a bit more manual than I’d like lol
alright, so if i output files +d -v to a file dirlist, then move that file to wherever I want the directory structure to be generated, I can then use
eo dirlist mkdir
and it goes right ahead and rebuilds the whole directory structure from the output file.
Now, unless I specify a [size] for the mkdir command, all of those directories will have the default file limit of 10, and thus get fragmented as the zoo command starts dumping files into them.
BUT
if I make sure to get a list of all the directory structure first, I can just put that file alongside the archive (or IN the archive), and then run eo dirlist mkdir -e after I have extracted the archive… it’ll give me a “permission denied” error for every directory that already exists, but it will still generate the remaining empty directories that were not included in the archive.
That may have solved this little problem, unless there’s potentially a more elegant solution
There are more elegant things that could be done,but they would require writing a C program.