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 to inbound and 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:
- Run setroot, then start the engine and test_process.
- 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
- 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. - 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”