Skip to main content

The snowcron script

The snowcron script installs and removes the scheduling for Snow Inventory Agent for Linux. It also installs and removes the scheduling for Snow Inventory Oracle Middleware Scanner (SIOMS), Snow Inventory Oracle Hardware Scanner (SIOHWS), and Snow Inventory Java Scanner (SIJS) in a Linux or Unix environment.

The script is always included in a Linux agent installation package. It is included in a Unix agent installation package when SIOMS, SIOHWS, or SIJS is included in the package. The default location of the script after installation is /opt/snow.

When executing the agent installation package on a computer, the script is run and creates a crontab file based on the periodicity specified in the cron configuration file, which must also be included in the agent installation package. The configuration file is included by default in the package, but you can select to add your own customized configuration file. The created crontab file is placed in a given directory. For example, for the Linux agent, the created crontab file is named snowagent and is placed in /etc/cron.d.

After installation, you can change the scan schedule via the command line. You can either replace the current cron configuration file with a new one and run the script using the -f command line option, or specify the periodicity directly on the command line.

EXAMPLE

Examples of changing the scan schedule via the command line.

  • Using a cron configuration file:

    ./snowcron -f /opt/snow/snowcron.conf /opt/snow/snowagent

  • Specifying the new periodicity directly on the command line:

    ./snowcron "0 21 * * *" /opt/snow/snowagent

The script adds nice -n 10 as prepend to the executable so that it does not use an inordinate amount of cpu. To avoid multiple scheduling occurrences, snowcron will automatically remove the current scheduling before adding a new one.

The script must be run with superuser privileges, which can be obtained by using, for example, sudo.

For more information on how to configure the scan schedule for the respective executable, see the respective user guide: Configure the scan schedule (Linux agent), Configure the scanner (SIOMS). Configure the scanner (SIOHWS), and Configure the scanner (SIJS).

Command line options

When the script is run via the command line, the following options can be used:

OptionDescription
-f <config>Update the scan schedule via a configuration file. Cannot be used with periodicity argument.
-u <user>Run executable as specific user, default: root (only applicable if /etc/cron.d exists).
-x <minutes>Sleep up to <minutes> before executing command (randomization).
-rRemove all scheduled occurrences of full-path-to-executable
-vVersion. Print version and exit with exit code 0.

Periodicity syntax

The periodicity of the scan schedule can be expressed as either crontab time and date fields, such as, for example, 0 21 1 * * (meaning nine in the evening the first day of the month), or a time period, which can be one of hourly, daily, weekly, or monthly.

The syntax is the same, regardless of whether the periodicity is specified on the command line or in a cron configuration file.

Cron configuration file

When using a cron configuration file to specify the periodicity of the scan schedule, the naming and content requirements described below must be fulfilled.

Naming

The configuration file must be named as follows, depending on the executable:

  • Snow Inventory Agent for Linux: snowcron.conf.

  • Snow Inventory Oracle Middleware Scanner: siomscron.conf

  • Snow Inventory Oracle Hardware Scanner: siohwscron.conf

  • Snow Inventory Java Scanner: sijscron.conf

Contents

The file can contain a mix of:

  • empty lines or lines with only whitespace characters in them.

  • comment lines, that is, lines whose first non-whitespace character is '#'.

  • exactly one line specifying the periodicity as either time and date fields or a time period, according to the periodicity syntax.

EXAMPLE

Here are some examples of configuration file contents:

# run snowagent at four twenty in the morning every day
20 4 * * *
# run snowagent at nine in the evening first day of the month
0 21 1 * *
# run snowagent at nine fifteen in the evening every Sunday
15 21 * * 0
# run snowagent hourly
hourly