Scheduling batch jobs using cron (on UNIX)

On UNIX systems, you can use a cron job to schedule batch jobs.

Procedure

  1. Create an ASCII text cron file, such as batchJob1.txt.
  2. Edit the cron file using a text editor to input the command to schedule the service.
    For example, the following command schedules a batch job to be run at 12:00 PM on March 19:
    * 0 19 3 * /usr/IBM/MDM/BatchProcessor/bin/runbatch.sh –job jobfile1.xml > 
    
    /usr/IBM/MDM/jobs/runbatch.log 1>/usr/IBM/MDM/jobs/batchJob1.log 
    2>/usr/IBM/MDM/jobs/batchJob1.err
    </dev/null
    Note: For more information, see the crontab documentation.
  3. To run the cron job, enter the command crontab batchJob1.txt.
  4. To verify the scheduled jobs, enter the command crontab -1.

    The batch processor will be invoked by the cron daemon according to the schedule.

  5. To remove the scheduled jobs, type crontab -r.

Example

cron job quick reference:

* * * * *     The command to be scheduled
| | | | |
| | | | +------------------ day of week: 0 - 6 (Sunday=0)
| | | +-------------------- month:  1 - 12
| |	+---------------------- day:  1 - 31
|	+------------------------ hour:  0 - 23
+-------------------------- minute:  0 - 59