Running Agents from the Command-Line

<< <%SKIN-STRTRANS-SYNTOC%> >>

Navigation:  »No topics above this level«

Running Agents from the Command-Line

You can run agents from the command line using the RunAgent.exe program, which you can find in the Content Grabber installation folder.

 

RunAgent.exe agentName

 

You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Content Grabber will look for the agent in the default location for the user running the program. If the agent is not located in that folder, Content Grabber will look in the default public agent location. The default public agent location is:

 

C:\Users\Public\Documents\Content Grabber 2\Agents

 

If your agent is not located in any of the default agent locations, you need to specify the full path to the agent file:

 

RunAgent.exe "C:\My Custom Folder\agentName.scg"

 

When running multiple agents in a batch file, you can use the Start command to run the agents asynchronously:

 

Start "WindowTitle" RunAgent.exe agentName1

Start "WindowTitle" RunAgent.exe agentName2

 

Exit Codes

The RunAgent.exe command line program returns one of the following exit codes:

Exit Code

Status

Description

0

Success

Data extraction was completed successfully.

1

Failed

A critical application error occurred during data extraction.

2

Incomplete

Data extraction was interrupted.

3

Completed with errors

Data extraction was completed, but with one or more page load errors or missing required elements.

4

Incomplete with errors

Data extraction was interrupted, and encountered one or more page load errors or missing required elements.

5

Export Failed

Data extraction failed because it was unable to export data. You can manually open Content Grabber and attempt to export.

 

Command Line Arguments

Input parameters can be added as command line arguments. The input parameter name must be preceded with a dash. For example:

 

RunAgent.exe agentName -username "test" -password "test"

 

Please see the topic Input Parameters for more information.

 

The following command line switches can be used, and should not have a preceding dash:

Switch

Description

log_level

Log detail level. Logging is turned off by default.

 

Example: RunAgent.exe agentName log_level High

log_html

Logs the HTML of all loaded web pages to files.

 

Example: RunAgent.exe agentName log_html

log_to_file

Logs information to a file instead of a database.

 

Example: RunAgent.exe agentName log_to_file

view_browser

Displays the web browsers used to navigate the target website.

 

Example: RunAgent.exe agentName view_browser

no_ui

No user interface will be displayed. This will cause an agent pause command to fail.

 

Example: RunAgent.exe agentName no_ui

session_id

The agent will run in a specified Session.

 

Example: RunAgent.exe agentName session_id sdgfdf4353

session_timeout

If an agent runs in a Session, this is the session timeout in minutes. The default session timeout is 30 minutes.

 

Example: RunAgent.exe agentName session_id sdgfdf4353 session_timeout 10

continue

Continues an agent that was stopped prematurely.

 

Example: RunAgent.exe agentName continue