6. Runtime Options

There are several xTuple Connect Batch Manager runtime options you can use when starting the xTuple Connect Batch Manager client from the command line. Any settings passed to the application using these options are valid only for the duration of the current xTuple Connect Batch Manager session. Once the xTuple Connect Batch Manager is stopped, running it again will revert to the defaults unless the options are passed again.

6.1. Connection Arguments

Connection arguments enable you to pass the database connection, username, and password information to the xTuple Connect Batch Manager at runtime. The following list describes the connection arguments which are available for use:

-databaseURL=

This argument enables you to pass the server, database name, and port. xTuple ERP runs on the PostgreSQL database, so the form of this argument is:

psql://server/databasename:port

For example, if you run PostgreSQL on a server whose IP address is 192.168.1.150 and the name of your database is xtuple_db and PostgreSQL is listening on port 5432, the argument would look like this:

-databaseURL=psql://192.168.1.151/xtuple_db:5432
-username=

This optional argument enables you to pass the username that the xTuple Connect Batch Manager will log in as. A common practice is to create a user through the xTuple client that has all application privileges—and is also a super user on the PostgreSQL database. (The super user requirement is needed to permit the user to perform database reindexing, which is part of the Schedule Server Maintenance job). While you want the xTuple Connect Batch Manager admin user to have all xTuple ERP privileges, you should consider withholding access to all xTuple ERP menus for this user. (To do this, simply de-select all the menu options on the User Preferences screen and revoke the MaintainPreferencesSelf and MaintainPreferencesOthers privileges.) This ensures that if a user logs into xTuple with the xTuple Connect Batch Manager user, no menu options will be available to them. To pass the username argument on the command line for a xTuple Connect Batch Manager admin user defined as "batch", the argument would look like this:

-username=batch
-passwd=

This optional argument enables you to pass the xTuple Connect Batch Manager admin user's password to the xTuple Connect Batch Manager client at log in. This is necessary if you plan to auto start the xTuple Connect Batch Manager when the computer the xTuple Connect Batch Manager is running on reboots. (For more information, see Section 7, “Automatic Startup Techniques”.) If you do not pass this argument, the password must be entered manually. For example, if the xTuple Connect Batch Manager admin's password is "@xbatch1", then the argument would look like this:

-passwd=@xbatch1

6.2. Tuning Options

In this section we describe several options available to you if you want or need to modify the default xTuple Connect Batch Manager timing options. The default xTuple Connect Batch Manager settings may not be ideal for every installation—or for every use case you may have at your site. The following interval arguments can be used to fine-tune specific timing intervals:

-refresh

The refresh interval argument defines in seconds how often the xTuple Connect Batch Manager attempts to reestablish a connection with the xTuple server. This is useful if the network connection is temperamental. The default is 86400, which is 1 hour. Here is an example where the interval is ten minutes:

-refresh 600

This option may also be reset temporarily in the xTuple Connect Batch Manager. Select BatchManager > Preferences, change the value of the "Between Database Connection Checks" field (minimum allowed value is 60, maximum allowed is 864000), and click OK.

-idle

The idle interval argument defines in seconds how long the xTuple Connect Batch Manager waits when there are no jobs presently scheduled before looking for a new job to process. The default is 300 (5 minutes). The following shows an example where the xTuple Connect Batch Manager will remain idle for 30 seconds when no jobs are presently scheduled before checking to see if there is a new job to run:

-idle 30

This option may also be reset temporarily in the xTuple Connect Batch Manager. Select BatchManager > Preferences, change the value of the "After the Last Pending Task" field (minimum allowed value is 30, maximum allowed is 864000), and click OK.

-rest

The number of seconds the xTuple Connect Batch Manager should wait between jobs after finishing a job (default is 30 seconds). The following shows an example where the xTuple Connect Batch Manager will remain idle for 10 seconds between consecutive jobs:

-rest 10

This option may also be reset temporarily in the xTuple Connect Batch Manager. Select BatchManager > Preferences, change the value of the "Between Consecutive Tasks" field (minimum allowed value is 0, maximum allowed is 864000), and click OK.

All of the above interval arguments may be issued individually or combined in a single command line statement or startup script. Here is an example combination you might use for the xTuple Connect Batch Manager executable on the Windows platform:

BatchManager.exe -databaseURL=psql://192.168.1.151/xtuple_db:5432 -refresh 600 -idle 30 -rest 15

In this example, the PostgreSQL server is 192.168.1.151, the name of the database is xtuple_db, and PostgreSQL is listening on port 5432. The xTuple Connect Batch Manager will check its connection to the database server every 600 seconds (10 minutes), check for new jobs every 30 seconds, and rest for 15 seconds after every job.

Note

xTuple recommends that you use the default values for these intervals. If you do change them, be careful not to set them too high or too low. The risk of setting them too high is that jobs won't be run in a timely manner. The risk of setting them too low is that the database server may get overwhelmed with requests from the xTuple Connect Batch Manager.