Running from the command line

You can run the Cleo Harmony, Cleo VLTrader, or Cleo LexiCom application from the command line (absent a GUI) to do the following:

Note:
  • In Unix, the backward slash character (\) is a special escape character. To use the backward slash character in a host\mailbox\action path as shown below, use two backward slashes (\\) or more instead of one. An alternative is to just use the forward slash (/) instead of the backward slash (\). If, however, the actual host, mailbox, or action name has a forward slash in its name, use two forward slashes (//) in its place.
  • Host actions are available only within the Cleo VLTrader and Cleo Harmony applications and, therefore, all references to hostaction should be ignored if you use the Cleo LexiCom application.
  • Since the special characters, <, >, @, /, and \, can be used to construct a host, mailbox, action, or hostaction string, you should avoid using these characters in the actual name of any of these objects.
  • Command line operations do cause extra system overhead. The system has to start up another JVM (Java Virtual Machine) as well as another copy of the Cleo Harmony, Cleo VLTrader, or Cleo LexiCom application. So, this startup process will use additional disk, memory, and CPU resources to run each command line. It might also use extra database resources depending on the command. The additional database connections are only active while the command line process is active. You should consider use of the API or web service to reduce the additional system overhead.

Using the command line

Run Harmony, VLTrader, or LexiCom from the command line.

Harmonyc [Import][Enable][Disable][Run][String] 
VLTraderc [Import][Enable][Disable][Run][String] 
LexiComc [Import][Enable][Disable][Run][String] 
Note: Be sure to run Harmonyc.exe, VLTraderc.exe, or LexiComc.exe in the Harmony, VLTrader, or LexiCom home directory rather than Harmony.exe, VLTrader.exe, or LexiCom.exe.

Command options

General options
-?
Show command line options.
-f "path"
Process command line options specified in a file.
-m
Show all messages; default is false.
-x
Show error messages only; default is false.
-l "path"
Generate a log file; replaces existing log file.
-b
Export (back up) specified files and directories to a zip file.
Import options
Use the -i option to import a host from a file. You can use the -e and -d options with the -i option to enable and disable actions, respectively, after import.
-i "path"
Import host; replaces existing host. See Importing and activating a host.
-e "<action>mailbox@host"
-e "host\mailbox\action"
Enable action(s); * and ? are supported. See Enabling or disabling actions.
-d "action>mailbox@host"
-d "host\mailbox\action"
Disable action(s); * and ? are supported. See Enabling or disabling actions.
Export options
Use the -b command to export (back up) specified files and directories to a .zip file.
-b [-f "xmlFileFilter path"] -d "zip file path" -pp "passphrase"
-b
Export (back up) specified files and directories to a .zip file.
-f
Specifies the XML file filter on which to export. If unspecified, the entire configuration will be exported.
-d "zip file path"
Specifies the name of the .zip file that contains the backed-up files. If the file already exists, this action will replace the existing .zip file.
-pp
Passphrase used during export.
Run options
Use the -r option to run an action. You can use the -c and -t options with the -r option to replace existing commands and modify properties, respectively.
-r "<action>mailbox@host"
-r "host\mailbox\action"
Runs one or more actions; * and ? are supported. See Run actions.
-c "command"
Replaces existing commands. You can use the -c option mutliple times.
-t "<Host><tag>value"
-t "<Mailbox><tag>value"
-t "<Action><tag>value"
Modifies a property value. Specifies a host-, mailbox- or action-level property modification, the name of the property (tag) and the new value of the property. You can use the -t option mutliple times. See Supplying new property values while running actions
Modify options
Use the -p option to specify a host, mailbox, or action you want to modify without running an actions and use the -t option to specify the property within that host, mailbox or action you want to change and its new value. You can specify more than one -t option for each -p option.
For examples of how to use -p and -t together, see Supplying new property values without running actions.
-p "<action>mailbox@host"
-p "host\mailbox\action"
-p "host/mailbox/action"
Specifies an action in a mailbox and host for which you want to modify properties.
-p "host\service"
Specifies a host and service for you which you want to modify properties.
-p "<hostaction>@host"
-p "host\\hostaction"
-p "host//hostaction"
Specifies a hostaction and host for which you want to modify properties.
-p "standalone action"
Specifies a standalone action for which you want to modify properties.
-t "<Host><tag>value"
-t "<Mailbox><tag>value"
-t "<Action><tag>value"
Specifies a host-, mailbox-, or action-level property modification, the name of the property (tag) and the new value of the property.
String options
-s "service"
Runs the Cleo Harmony, Cleo VLTrader, or Cleo LexiCom application as a service. See Running as a service.
-s “remote,target”
Runs the Cleo Harmony, Cleo VLTrader, or Cleo LexiCom application remotely. See Running as a service.
-s "license"
Displays license information. See Printing license information.
-s "version"
Displays version information. See Printing version information.
-s "service,stop"
Waits for ongoing transfers to complete and then stops the service.
-s "service,kill"
Stops the service immediately without waiting for ongoing transfers to complete.
-s "scheduler,start"
Starts the scheduler.
-s "scheduler,stop"
Stops the scheduler.
-s "router,start"
Starts the router.
-s "router,stop"
Stops the router.
-s "transfers"
Generates a transfer report. See Transfers.

Printing command line options

Print a list of command line options.

Harmonyc –?
VLTraderc –?
LexiComc –?

Printing messages

Print all messages ( -m) while processing command line.

Harmonyc –m ... 
VLTraderc –m ... 
LexiComc –m ... 

Print only error messages (-x) while processing command line

Harmonyc –x ... 
VLTraderc –x ... 
LexiComc –x ... 

You can use either of these options with –i, -e, -d, -r, or –s.

You can increase your screen buffer width to ~160 characters to avoid message line wrapping.

Generating a log file

Generate a log file ( -l) while processing a command line.

Harmonyc –l “path” ...
VLTraderc –l “path” ...
LexiComc –l “path” ...

You can use this option with –i, -e, -d, -r, or –s.

If the log file already exists, it is overwritten.

The system log file is not affected by this option.

Importing and activating a host

Import and activate a host ( -i)

Harmonyc –i “path
VLTraderc –i “path
LexiComc –i “path

path must point to a valid .zip file.  The .zip should be structured to match the directory structure of Cleo Harmony, Cleo VLTrader, or Cleo LexiCom. If it is a just file in a .zip, it is placed in the appropriate home directory.

If the active host alias already exists, it is overwritten.

You can use the -i option to import patch files (usually in conjunction with -m):

Harmonyc –i “path_to_patch_file/0.1.zip

The -r option can follow this option to run a newly imported host.

Enabling or disabling actions

Enable ( -e) one or more actions.

Harmonyc –e “<action>mailbox@host
Harmonyc –e “host\mailbox\action
VLTraderc –e “<action>mailbox@host
VLTraderc –e “host\mailbox\action
LexiComc –e “<action>mailbox@host
LexiComc –e “host\mailbox\action

Disable ( -d) one or more actions

Harmonyc –d “<action>mailbox@host
Harmonyc –d “host\mailbox\action
VLTraderc –d “<action>mailbox@host
VLTraderc –d “host\mailbox\action
LexiComc –d “<action>mailbox@host
LexiComc –d “host\mailbox\action

You can specify either action path format.  You can use * and ? to wildcard the path and possibly match more than one action. You can use / instead of a \.

You can specify a partial path (for example, host or host\mailbox or mailbox@host) to enable or disable ALL actions within the path.  * and ? can also be used to wildcard the partial path.

Run actions

Run one or more actions ( -r).

 Harmonyc –r “<action> mailbox@host
 Harmonyc –r “host\mailbox\action
 VLTraderc –r “<action> mailbox@host
 VLTraderc –r “host\mailbox\action
 LexiComc –r “<action> mailbox@host
 LexiComc –r “host\mailbox\action

You can specify either action path format.  You can use * and ? to wildcard the path and possibly match more than one action. You can use / instead of a \.

You can specify a partial path (for example, host or host\mailbox or mailbox@host) to run ALL actions within the path.  * and ? can also be used to wildcard the partial path.

If more than one action is matched, the actions are run sequentially one-by-one. 

See sample.bat in the Cleo Harmony, Cleo VLTrader, or Cleo LexiCom home directory for an example.

Supplying new property values while running actions

Supply new property values while running one or more actions ( -r with -t/ -n).

 Harmonyc –r “<action>mailbox@host” –t “<Action><Commands>PUT ...” –n “GET ...” ... 
 VLTraderc –r “<action>mailbox@host” –t “<Action><Commands>PUT ...” –n “GET ...” ... 
 LexiComc –r “<action>mailbox@host” –t “<Action><Commands>PUT ...” –n “GET ...” ... 

The -t option specifies a host-, mailbox- or action-level property modification, the name of the property (tag) and the new value of the property. The property names correspond to the tagged values in the host XML file. See XML file formats for information about the layout of a host XML file.

You can use the -t option mutliple times.

To specify a multi-line value, use –t to specify the first line, and then immediately following specify each remaining line with –n values.

More than one –t value (followed by –n values) can be specified to update multiple properties.

If more than one action is being run, the tagged values are applied to each action as it is run.

Supplying new property values without running actions

Supply new property values without running any actions (-p with -t/ -n).

 Harmonyc –p “<action>mailbox@host” –t “<Action><Commands>PUT ...” –n “GET ...” ... 
 VLTraderc –p “<action>mailbox@host” –t “<Action><Commands>PUT ...” –n “GET ...” ... 
 LexiComc –p “<action>mailbox@host” –t “<Action><Commands>PUT ...” –n “GET ...” ... 

The -t option specifies a host-, mailbox- or action-level property modification, the name of the property (tag) and the new value of the property. The property names correspond to the tagged values in the host XML file. See XML file formats for information about the layout of a host XML file.

You can use the -t option mutliple times.

To specify a multi-line value, use –t to specify the first line, and then immediately following specify each remaining line with –n values.

More than one –t value (followed by –n values) can be specified to update multiple properties.

Running as a service

Run the Cleo Harmony, Cleo VLTrader, or Cleo LexiCom application as a service ( -s):  

 c –s “service” 

Running the Cleo Harmony, Cleo VLTrader, or Cleo LexiCom application as a service is identical to how they run when installed as a Windows service.  Installing and running as a service has the following advantages:

Running remotely

Run the Cleo Harmony, Cleo VLTrader, or Cleo LexiCom application remotely ( -s):

Harmonyc –s “remote,target” ... 
VLTraderc –s “remote,target” ... 
LexiComc –s “remote,target” ... 

This option can be used with -e, -d, or –r.  The action paths specified with these options must exist within Cleo Harmony, Cleo VLTrader, or Cleo LexiCom on the target computer.

The target can be specified as a computer name or IP address. The Cleo Harmony, Cleo VLTrader, or Cleo LexiCom application must be installed and/or running as a service ( –s “service”) on the target server for the remote command to be accepted. 

The -l option can be used to generate a local log file.

This option only requires a license on the target computer. 

Printing license information

Print current license information ( -s):

Harmonyc –s “license” 
VLTraderc –s “license” 
LexiComc –s “license” 

This will generate output similar to the following:

 License Key                 = eb]|-y{8R-LyLo-GGjd-M{42-GkE4-QI7B-mqL^
License Owner               = Cleo Communications
Serial Number               = LX9012
Host ID                     = LO6354 
Key Expires                 = 2003/01/08 (evaluation) 
Max # of Hosts              = Unlimited
Max # of Mailboxes per Host = 5 
Translator Integration      = Yes
AS2                         = Yes
FTP                         = Yes
FTP/S                       = Yes
HTTP                        = Yes
HTTP/S                      = Yes 
API                         = Yes 

Printing version information

Print current version information ( –s).

Harmonyc –s “version” 
VLTraderc –s “version” 
LexiComc –s “version” 

This will generate output similar to the following:

 Version = 2.0.03 
 2002/05/08 07:48:28 CDT   as2bean.jar 
 2002/04/29 16:31:22 CDT   dcebmxhttpsbean.jar 
 2002/05/09 09:48:54 CDT   ftp.jar 
 2002/05/09 09:48:58 CDT   ftps.jar 
 2002/05/06 16:57:26 CDT   httpbean.jar 
 2002/04/26 16:37:54 CDT   HTTPClient.jar 
 2002/05/06 16:57:30 CDT   httpsbean.jar 
 2002/05/06 16:57:20 CDT   lexbean.jar 
 2002/05/08 09:53:38 CDT   LexiCom.jar 

Processing command line options from a file

Process command line options specified in a file ( –f) .

Harmonyc –f “path
VLTraderc –f “path
LexiComc –f “path

And an example file:

 -m 
-l log.xml 
-i "hosts\preconfigured\ABC VAN.xml" 
-r "ABC VAN\myMailbox\send+receive" 
-t "<Host><Inbox>G:\edi\in\" 
-t "<Host><Outbox>G:\edi\out\" 
-c "CONNECT user=test,*pswd=test" 
-c "PUT -DEL .\ receiver=EDI,type=X12" 
-c "GET -DIR -CON -UNI .\[type]=X12" 

The contents the file can contain any of the other command line options besides –f. Within the file, arguments can be separated by spaces and/or exist on separate lines.

Importing files

Import a file originally exported from the Cleo Harmony, Cleo VLTrader, or Cleo LexiCom application:

VersaLexc -i VersaLexConfig.zip -pp cleocleo -cp keypswd1 -cp keypswd2 -m
where:
-i VersaLexConfig.zip
Import the file, VersaLexConfig.zip.
-pp cleocleo
Specifies that cleocleo is the passphrase used when the data was exported.
-cp cleo -cp keypswd1 -cp keypswd2
Provides certificate private key passwords the system attempts to use in rotation until one matches.