E. UPLOAD/CHECKPOINT/SAVEALL all CPs IN THIS AP
E1. updatecp
As you should know by now, it takes a loooooong time to do the normal CP databases maintenance tasks:
If you forget to do these tasks periodically, you know what you might face ...
the next time you NEED to restore a CP.
Well, this script "updatecp" will do all those three tasks for you. If you run it at midnight, it will have the rest of the night to finish and have the system ready when the Process Control engineers return to work at 7:00 am.
At our HL plant for example, it takes 5 hours to finish the three tasks for: 12 CP40s, 2 CP30s, 1 IG, 1 FDG, and 2 AB stations. The script is run by cron every 15 days and the saveall files are sent to another station, just in case the host station crashes, as it happened at our FCC plant.
The script should be run only on AP/AWs hosting CPs. There are only two items that you have to add/modify to the script, the rest is automatic. "updatecp" will detect all hosted CPs and their types, all WP/AW/PWs, etc.
Because the upload and checkpoint procedures requires that nobody is accessing the CP at that moment, the script will send warning messages to all screens on the system, except to remote Display Managers (unless you add them manually). Anyway, if the CP is locked at that moment, the script will skip that part for that CP.
For each CP, the saveall files will be stored in directory: /opt/saveall/CPLBUG. The script will try to create those directories, if they do not exist.
After the Saveall part is finished, "updatecp" will tar those directories/files to a single file: svallAPLBUG.tar
Then, it will do the same with all current Checkpoint files, just in case you need them later. The tar file in this case will be: chkptAPLBUG.tar
Both tar files will then be compressed and sent via FTP to another 50 station (following ISO-9000 rules), as a second backup. The directory /opt/saveall should have been created on that station. This is the second item that you must add to the script.
Finally, the script will send the log file to the master (you) via e-mail, so you will be notified of what happened that night. Of course, this part will work only if you have modified your sendmail configuration file.
Final note :
If your CP database got corrupted, you will be saving a damaged file to the hard disk. However, if you are doing regular backups to your 50 stations, you can always get an older undamaged CP database from the backup tapes.
E2. hd2fd
In relation with the Saveall procedure, I found once the need to have real SaveAll diskettes instead of having the files on the hard disk. In order to solve a CSA corruption problem I needed to load single compounds to the CP. The LoadAll script on the API utilities allows you to load ALL compounds at the same time, but not one at a time.
To automate this procedure I created "hd2fd". Its use will not be frequent, but the time you are in trouble it will help you to produce those precious Saveall diskettes very quickly. You need to use Formatted (with File system) diskettes.
E3. svall_rd
In the same area of Savealls, I need sometimes to catalog SaveAll diskettes, looking for dates, etc. This simple script "svall_rd" will: mount the diskette, read and list its compounds, umount diskette, and finally eject it.
This page hosted by
Get your own Free Home Page