Managing Batch Jobs

A guide to running batch jobs and processes in Mifos

Overview of Batch Jobs

Batch processes (also known as cron jobs on Unix-based systems) are a series of back-end jobs on a computer that are executed through predefined scripts. Mifos currently has 9 of these batch processes which are scheduled to run nightly. The server must be running for the batch jobs to run.

Mifos users will be automatically logged out when batch jobs run, and no logins are permitted until the batch jobs complete. 

A message displays on the login screen indicating that cron jobs are running.  The recommendation is to run batch jobs after business hours.

Reports run before batch jobs have been completed will not reflect the results of the batch jobs.

Mifos Batch Jobs

Please see Batch Jobs for a functional description of all batch jobs in Mifos.

Setup and Configuration

First, see the configuration guide.

To change the batch job schedule in Mifos v1.3 or later, a custom task.xml can be copied out of source control and placed in one of the MifosConfigurationLocations. For earlier versions, you must follow the procedures below. If you have not worked with .war files, please refer to the UsingWarFiles wiki page.

Options for Changing .WAR Files

You must modify Mifos configuration files and then re-deploy the Mifos.  You can accomplish this task in two ways.  The option you choose will depend on how you deployed Mifos and what you feel comfortable doing.

1) Unpack the .war file into the web server directory and modify the files.

  • Directions for unpacking .war files and using full directories in your servlet (Jetty, Tomcat, JBoss) can be found on the UsingWarFiles wiki page

2) Unpack the .war, modify the files, create a new .war, and redeploy the .war file.

Steps to modify  and repack .war files

1) Unpack the.war file (see UsingWarFiles wiki page)
2) Make the changes the the files as specified below.
3) Rebuild the .war file using jar (see UsingWarFiles wiki page).
4) Deploy the new .war file into the web server deploy directory

Changing Batch Schedules

Batch jobs are configured in task.xml.

  • There is a 'Batch Jobs' page to display information about configured batch jobs.
  • The above batch jobs run sequentially.
  • The initial starting time can be set in task.xml mentioned above.
  • Currently,  task.xml is configured by default to run every night at midnight.
  • The time is based on the server's system time.  On a Windows machine, system time will likely be local time.

To change the batch jobs (you should review the items above on .war file options first):

  1. Stop Mifos application on the web server.
  2. Make the changes to task.xml. Please see Quartz Batch Jobs page for more details.

Monitoring

Batch Jobs can be managed in Mifos under Batch Jobs in the Admin section.  The Batch Job Scheduler is Active by default.  The Scheduler can be put in Stand-by Mode by clicking Suspend. 

This section also allows running of each batch job individually.  Select the tasks to run, and click on Run Selected Tasks to run the batch jobs immediately.  Each scheduled task is listed with the following information:

Property Description
Next Start Lists when the next start time is for the scheduled task
Previous Start Previous Start time for the scheduled task
Most recent successful run Last successful Start time for the scheduled task (displayed only when the previous scheduled task run failed)
Task Type CronTrigger or SimpleTrigger
Task Priority Order in all batch jobs of which it is run.  If it is all the same, then it is just run in the order listed in the table.  Lower number takes higher priority and will be run first
Previous run status Completed or Failed (also a detailed failure reason can be displayed here, if available)
Cron expression (only for CronTrigger) Expression which determines when batch job should be started (Please read Cron Trigger Tutorial for a more detailed documentation)
Repeat interval (only for SimpleTrigger) Number of milliseconds between successive batch job runs

 

0
Your rating: None