UNIX example for smatdb cycle implementation

For this example, the site name is test_site. This site contains a process named test_process that has one thread named test_thread. This thread is set as Save inbound messages to inbound and Save outbound messages to outbound.

The embedded crontab in systems similar to Unix is used to finish the time-based smatdb cycle. This indicates you must have basic knowledge of corn and its time/date field setup. The crontab task is created to do the cycle on a regular basis.

To begin:

  1. Run setroot, then start the engine and test_process.
  2. To cycle smatdb:
    $hcismatcycle -s test_site -p test_process -t test_thread -b in -r $HCIROOT/test_site
    $hcismatcycle -s test_site -p test_process -t test_thread -b out -r $HCIROOT/test_site
  3. You should maintain all cycle tasks in a special shell script. For example, create a shell file named hcismatdbcycle.sh and edit it:
    #!/bin/bash
    setroot
    #task 1
    hcismatcycle -s test_site -p test_process -t test_thread -b in -r /opt/cis19.1/integrator/
    #task 2
    hcismatcycle -s test_site -p test_process -t test_thread -b out
    #task 3
    hcismatcycle -s other_site -p other_process -t other_thread -b in -r /opt/cis19.2/integrator/
    …
    Note: If the -r option is not used, then the current HCIROOT is the default.
  4. Create a crontab task of it:
    $crontab -e
    */1 * * * * /bin/bash /the/path/of/hcismatdbcycle.sh

    Set up a reasonable time schedule. In this example, the tasks in hcismatdbcycle.sh are run every minute.

On Linux, you can check the cron log at /var/log/cron. You can redirect the log to any specified location.

The scheduler task calls cmd.exe to run hcismatdbcycle.bat.

setroot requires administrator privilege. You can use PowerShell to ensure setroot was successfully set in the bat file. This is accomplished by running a command in cmd.exe similar to:

$schtasks /create /sc minute /mo 1 /tn "smatdbCycle" /tr “powershell -Command Start-Process -Verb 
RunAs C:\The\location\of\hcismatdbcycle.bat”