Site Server Express - Command-Line Operation

Both Usage Import and the Report Writer support command-line operation to facilitate automation. To determine the correct command-line syntax for any module, you can use the help command-line flag.

A module run from the command line can run in verbose mode (the default) or in silent mode (by using the -silence command-line flag). If a module is run in verbose mode, it presents a modal message box to the user for each message. The message box halts operation until you choose OK. If a module is run in silent mode, modal message boxes are never presented to the user.

In silent mode, all messages are written to a message log file. The default file name for the message log is a {MODULE NAME}.LOG in the \MESSAGE subdirectory of the directory containing the module executable. (For example, C:\PROGRAM FILES\INTERSE3\MESSAGE\ANALYSIS.LOG for the Report Writer message log). This message log file can be changed by using the messagelog command-line flag.

Both of the components connect to a database before executing a task. By default, the components connect to the last database that was used on the system. If you are using a Microsoft Access-compatible database and you want to use this same database, you do not need to use the db command-line flag. If you want to specify a different database, the argument consists of the complete path to the .MDB database file, as shown in the examples below:

  • db="DRIVE:\DIRECTORY\DATABASE.MDB"

  • db="\\HOST\DIRECTORY\DATABASE.MDB"

For all command-line arguments, file paths can contain lone file names and network resources (\\FIDO SERVER\FILE NAME EXT).

For command-line arguments that include spaces, quotes are mandatory. This is common with filters and long file names, such as C:\PROGRAM FILES\….

If the command-line argument is a filter that includes a double quote, such as Title="", the filter should be enclosed in single quotes: 'Title=""'.

Command-line flags can be listed in any order.

Running Usage Import from the Command Line

There are six correct forms for Usage Import command-line syntax: (optional parameters enclosed in [])

  1. To determine the command-line syntax from the command line:

    IMPORT.EXE help 

  2. To import a log file:

    IMPORT.EXE [-silence] log=" x " [logsource=" x "] [db=" x "] [messagelog=" x "] 

    log is the path to a log file to import. The text here is equivalent to the text that would be typed into log location in the Log File Manager. 

  3. To delete from the database:

    IMPORT.EXE [-silence] delete=" x " [db=" x "] [messagelog=" x "] 

    This task is equivalent to the Delete option on the Tools menu. The filter specified with the delete argument is equivalent to the filter typed into that window. 

  4. To look up HTML titles:

    IMPORT.EXE [-silence] title=" x " [db=" x "] [messagelog=" x "] 

    This task is equivalent to the Lookup HTML Titles option on the Tools menu. The filter specified with the title argument is equivalent to the filter typed into that window. 

  5. To resolve IP addresses:

    IMPORT.EXE [-silence] action="ipresolution" [db=" x "] [messagelog=" x "] 

    This task is equivalent to the Resolve IP Addresses option on the Tools menu. 

  6. To run Whois queries:

    IMPORT.EXE [-silence] action="whois" [db="x"] [messagelog="x"] 

    This task is equivalent to the Whois Organizations option on the Tools menu. 

Running the Report Writer from the Command Line

The are two Report Writer executables: ANALYSISGUI.EXE and ANALYSIS.EXE. ANALYSISGUI.EXE provides the user-interface for editing analysis files. ANALYSIS.EXE is the executable that creates reports and offers a command-line interface. There are two correct forms for Report Writer (ANALYSIS.EXE) command-line syntax: (optional parameters enclosed in [] )

  1. To determine the command-line syntax from the command line:

    ANALYSIS.EXE help 

  2. To create an analysis report:

    ANALYSIS.EXE analysis=" x " report=" x " [template=" x "] [rootfilter=" x "] [db=" x "] [messagelog=" x "] 

    Analysis is the analysis file, .MFA, that defines the analysis to be run on the database. Report is the output report document. The format of the report—HTML, Word, Excel, or text—is defined by the file extension .HTML, .DOC, .XLS, or .TXT, respectively. The .MFA file includes the last template specified by the Report Writer user interface. If you want to override this selection, use the template argument. Likewise, if you would want to override the specification of the filter of the root section of the analysis, use the rootfilter flag. 

Command-Line Argument Date Variables

For all modules, several command-line flags are subject to date-variable replacement modeled after the UNIX date command. For example, if a log file name is specified as ACCESS-$M.$D, this argument will be replaced by ACCESS-02.02 if run on February 2, and ACCESS-02.03 if run on February 3. A complete list of date variables can be found in the following table. The command-line arguments that can use this feature are:

  • messagelog (all)

  • log (IMPORT.EXE)

  • report (ANALYSIS.EXE)

  • subject (MAIL.EXE)

Command-line variable

Replaced by

$A

the full weekday name

$a

the abbreviated weekday name, where the abbreviation is the first three characters

$B

the full month name

$d

the day of the month as a decimal number (01-31)

$e

the day of month as a decimal number (1-31); single digits are preceded by a blank

$H

the hour (24-hour clock) as a decimal number (00-23)

$I

the hour (12-hour clock) as a decimal number (01-12)

$j

the day of the year as a decimal number (001-366)

$k

the hour (24-hour clock) as a decimal number (0-23); single digits are preceded by a blank

$l

the hour (12-hour clock) as a decimal number (1-12); single digits are preceded by a blank

$M

the minute as a decimal number (00-59)

$m

the month as a decimal number (01-12)

$p

``AM'' or ``PM'' as appropriate

$S

the second as a decimal number (00-60)

$s

the number of seconds since the January 1, 1969 at 4:00 p.m.

$U

the week number of the year (Sunday as the first day of the week) as a decimal number (00-53)

$W

the week number of the year (Monday as the first day of the week) as a decimal number (00-53)

$w

the weekday (Sunday as the first day of the week) as a decimal number (0-6)

$Y

the year with century as a decimal number

$1

yesterday's date in $m$d$y format