I think I can use the backup command to recursively copy directories,
subdirectories, and their files to a new location, without having to manually create all the new directory paths in the target location.
Yes, e.g.:
$ backup /dir1 /dir2 +a
In case you don’t know, most QNX 2 commands have some internal documentation that you can get this way:
$ backup
For copying files to a destination where the target directories and subs do not yet exist;
- Is there any way to do this with the CP or COPY commands?
Not a good idea. You would need to make the directories with mkdir and copy each directory one at a time. Use backup.
- Is there any practical way to do this via FTP?
I really don’t know what you are thinking here. FTP is not native to QNX 2. There were 2 or 3 implementations, at least two of which were specific to a piece of hardware. QNX 2 TCP/IP was not at all standard and limited in a number of ways. So any questions about ftp will have to be for a specific implementation.
Now ftp has the capability to upload or download a directory recursively, but you really don’t want to to use it locally.
I am not intimately familiar with the QNX environment yet but I’m learning a little more every time I dig into things.
The original documentation can be found online if you know where to look. That can help.
The software we run is built on an instance of QNX2.21. The software has a pretty decent file manager and also automates some aspects of FTP transfer of data captured within the software, but I’m fairly certain the devs never really anticipated anyone to be bumbling around in the background within QNX…
QNX 2.21 was the last release. When you say file manager, are you running under QNX WIndows? There were a few text menu interfaces.
My job isn’t so much to use the software for its intended purpose, but rather to maintain the machines, so I’m trying to get a handle on how best to backup the important components of the software and find a method to streamline the process.
Unless you can run your application on a VM, you are in a world of hurt when it comes to hardware. I’m about to unload a lot of archaic hardware that has accumulated over the years so you may want to contact me about this. maschoen@pobox.com.
I’m also one of the few remaining experts with QNX 2 in case you need some kind of support.
(also, is it possible to delete a folder and its contents, or do I have to individually delete individual files first?
I don’t recall whether “erase” has a recursive version, but I doubt it. I think my own method was as follows.
-
Use the “files” command to create a text file with a list of files.
-
Use ed to edit the file and put "erase " in front of each file name.
-
Run the file as a script
-
Repeat using the +d (directory) and add “rmdir” to each directory name.
You may have to run this script a few times to get everything.
There may be a utility that does this more directly, but I don’t recall.
I figured just blindly pointing rmdir at a directory might work, but since QNX has such funky file handling, I wasn’t sure if that would leave some kind of remnants that might screw something up)
I’m quite sure that rmdir will only delete one directory, not files recursively.
If you are brave you can run “zap” and then “chkfsys”. Zap removes a directory and all its descendants from the file system without reclaiming the sectors. Chkfsys checks the file system and finds any lost sectors. You don’t want to run chkfsys when you have any open files.
[yes it’s old, no the software doesn’t exist on any other platform, yes it will eventually be replaced but that process is very slow so these machines need to be supported/understood/maintained for at least another ten years…
Ouch. You should put me on retainer. That’s going to be a tough one.
I’ve actually built fresh replacement machines from new industrial pentium-4 boards with ISA slots so we have some physical hardware replacements ready to swap out when/if any of the old machines fully fail]
So, here in a nutshell is my recollection of problems you will have running QNX 2 on a pentium. There’s a utility to fix a bug with the floppy driver on fast cpu’s. Without going into details, I don’t know if it will work on a Pentium. It probably depends on the speed. I don’t know if you need a floppy, but it’s pretty tricky to run QNX 2 without one.
If you are using QNET, there is a race condition that will cause you to lose virtual circuits. You can just reboot if that is feasible. There was a utility that was supposed to clean things up and I never got it to work.
Good luck