Novell Home

Save Your Weekends with CRON

Novell Cool Solutions: Tip

Digg This - Slashdot This

Posted: 6 Oct 2004
 

Perhaps you've wanted to kick off a process on a NetWare server during the weekend, but you didn't want to spend your time on the weekend to do that. This article explains how to do the work now, so your love of NetWare won't overshadow your love of barbecues and picnics ...

For the complete text on this topic, see TID 10058252.

The following explains an automated routine to have the GroupWise POA completely re-index a GroupWise post office every week. This shows a precise solution, but you can use it as a guide to create other automated solutions to use on a NetWare server.

Scenario

The GroupWise POA leaves all kinds of garbage files in the PO\OFUSER\INDEX directory. Currently the only way to clean up these files is to issue a CTRL-Q on the GroupWise POA. The regular QuickFinder Indexing process that you can scheduled on the POA, does not do the same thing as the CTRL-Q keystroke from the GroupWise POA's NetWare console screen. One customer reported that doing a CRTL-Q on their GroupWise POA helped them net about 400 megs of disk space the first time they ran it.

(See the following document for more information on this concept of using CTRL-Q: http://support.novell.com/cgi-bin/search/tidfinder.cgi?2956138)

Solution

To automate the CTRL-Q routine, we'll use Novell's NCSCRIPT, COPY and CRON NLMs to create an automated solution that hits CTRL-Q on the GroupWise POA every Saturday at 9:00 P.M.

The NCSCRIPT.NLM allows you to pass keystrokes to any screen on a NetWare server that has a user interface. When NCSCRIPT is first loaded, it makes a simple queuing structure in a directory it creates off the root of the SYS: volume called "DISTRIB". Script files can be placed in the SYS:DISTRIB\JOB directory, and NCSRIPT will poll that directory for script jobs when it is loaded. If NCSCRIPT is already loaded, it polls the DISTRIB\JOB directory every 5 seconds.

The NCSCRIPT.NLM and its documentation can be found at: http://www.novell.com/coolsolutions/tools/1169.html

This script must be modified to match the POA you're running on your server. For example, if the post office is called ACMEPO, and the post office is below a domain is called CORP, you could run a job file (such as QFPOAJOB) like this:

ROBOT: "GroupWise POA - ACMEPO.CORP" <CTRL-Q>

In our scenario we will save this ASCII text file to the SYS:DISTRIB directory. The file must not have a file name extension (such as QFPOAJOB, not QFPOAJOB.TXT). This script file tells NCSCRIPT to go to the screen called "GroupWise POA - ACMEPO.CORP" and hit the combination keystroke of "Ctrl-Q".

Setup Steps

  1. Place the NCSCRIPT.NLM in the SYS:SYSTEM directory.
  2. Load NCSCRIPT once, then unload it. This will create the SYS:DISTRIB directory and queue subdirectories.
  3. Create the QFPOAJOB file in the SYS:DISTRIB directory. You can copy and paste the script created in the Scenario section above and save it to an ASCII file. Then customize it appropriately.
  4. Place the COPY.NLM in the SYS:SYSTEM directory.
  5. The COPY.NLM will be used to copy the QFPOAJOB file from the SYS:DISTRIB directory to the SYS:\DISTRIB\JOB directory. (The COPY.NLM has now been replaced by the TOOLBOX.NLM. We're using COPY.NLM as it tends to simpler to use - it's available at: http://www.netwarefiles.com) To have the CRON.NLM run the QFPOA.NCF every Saturday at 9:00 P.M. the SYS:ETC\CRONTAB file would look like this:

    00 21 * * 6 QFPOA.NCF

    Note: Make sure the CRONTAB file does not have an extension to it.


  6. Put the LOAD CRON.NLM command in the AUTOEXEC.NCF file of your file server.
  7. Put the CRON.NLM in the SYS:SYSTEM directory.
  8. Create your CRONTAB file and place it in the SYS:ETC directory.
  9. Load CRON.NLM.

QFPOA Job Steps

The CRON.NLM will load our QFPOA.NCF file every Saturday night at 9:00 P.M. Now we need to modify the QFPOA as follows:

  1. Use the COPY.NLM to copy the QFPOAJOB file to SYS:DISTRIB\SCRIPTS\JOB directory for NCSCRIPT to process it.
  2. Load NCSCRIPT so it performs the CTRL-Q function on the POA.
  3. Unload both the COPY.NLM and the NCSCRIPT.NLM so they are not resident in memory.
  4. Using the QFPOA.NCF sample below, create the QFPOA.NCF file and place it in the SYS:SYSTEM directory.

Results: The CRON.NLM will run the QFPOA.NCF file every Saturday at 9:00 P.M. The COPY.NLM will copy the NCSCRIPT job file, just before NCSCRIPT loads. The NCSCRIPT.NLM will select the CTRL-Q keystrokes on the POA, and the POA will totally re-index the post office and delete un-needed files in the PO\OFUSER\INDEX directory.

QFPOA.NCF Sample


# QFPOA.NCF BEGIN

# This unloads the COPY.NLM, so if it's already loaded
# there are no errors when this NCF tries to load it again

UNLOAD COPY.NLM

# This unloads the NCSCRIPT.NLM if it's already loaded
# there are no errors when this NCF tries to load it again

UNLOAD NCSCRIPT.NLM

# This uses the COPY.NLM to copy the file called QFPOAJOB
# to NCSCRIPT'S # incoming job queue

LOAD COPY SYS:DISTRIB\QFPOAJOB SYS:DISTRIB\JOB\QFPOAJOB

# This unloads COPY.NLM, after a 10-second wait.
# The question mark tell the NetWare 4.11 and 5.x
# OS to pause 10 seconds (by default)

? UNLOAD COPY.NLM

# This loads NCSCRIPT and tells NCSRIPT not to purge its
# JOB queue, which NCSCRIPT usually does on startup.
# NCSCRIPT will first process the QFPOAJOB script
# and then it will purge the QFPOAJOB file

LOAD NCSCRIPT /NOPURGE

# This unloads causes a 10-second delay for
# NCSCRIPT to load and process its job.

? CLS

# This unloads NCSCRIPT after 10 seconds. In total we
# have given NCSCRIPT 20 seconds,more than enough time.

? UNLOAD NCSCRIPT

# QFPOA.NCF END

About CRON

The CRON.NLM is an NLM that reads an ASCII text file called "CRONTAB" that you create in the SYS:ETC directory. The CRONTAB file tells the CRON.NLM when to run a NetWare console process, such as a NetWare *.NCF batch file. The formatting for the CRONTAB, and the CRON.NLM can be obtained at the following URL:

http://support.novell.com/cgi-bin/search/tidfinder.cgi?2939440


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell