SameGoal Special Programs
search
SameGoal Special Programs

SG-Agent




Support > Online Guides > Technical Guide > SG-Agent
download

sg-agent.zip is Microsoft Windows™ executable recommended for routine, automatic uploads. SG-Agent can be run as a program to streamline integration, an SFTP client, or both.

When run as a program to streamline integration, SG-Agent:

When used as an SFTP client, SG-Agent connects to a SameGoal SFTP server and uploads files using a directory structure recognized by SameGoal.

Steps
To use SG-Agent:

  1. Download sg-agent.zip
  2. On a host from which an ODBC connection can be established with the database server, extract the program files to a directory of your choice. If you have no preference, extract these files to C:\sg-agent\.
  3. Place your OpenSSH-style public key (id_rsa.pub) and OpenSSH-style private key (id_rsa) in the certs directory (eg C:\sg-agent\certs\) to enable public/private key authentication. The keys are those generated when you configured your SFTP account.
  4. Modify config.txt (eg C:\sg-agent\config.txt). See instructions below.
  5. Schedule a task to run C:\sg-agent\sg-agent.exe nightly.

config.txt:

SG-Agent is configured using a single text file located at C:\sg-agent\config.txt. The format of config.txt is:

Arguments for each command:

Command Line Usage:

For most users (those uploading data for a single district), sg-agent.exe can be run directly without any flags. Simply add a Windows™ Scheduled Task to run the sg-agent.exe program once per day. Advanced users: If you wish to check the return status of sg-agent or configure uploads for multiple districts, SG-Agent returns 0 in the event of success and a non-zero value in the event of failure. In Windows, to echo the return code of the preceding command, use ECHO.%ERRORLEVEL%. Example:

To check for a non-zero return code use IF %ERRORLEVEL% NEQ 0 .... Example:

SG-Agent uses Google-style command line flags to configure execution. To see a list of all supported flags, run sg-agent.exe with the -help flag. Example:

SG-Agent can be run with multiple different config files using the -config flag. Example:



info