odbc_connection_string - The connection string used to connect to your database server. This should should include information such as your database server username and password as well as the hostname of the database server. Please consult your database server documentation or connection strings examples for help in finding the correct database server connection string. This command may be specified zero or one times in the config.txt file. Example valid connection strings:
- odbc_connection_string: <connection_string> # syntax
- odbc_connection_string: Driver=SQL Anywhere 10;Uid=<sql_anywhere_username>;Pwd=<sql_anywhere_password>;Eng=psi;Dbn=gatekeep;Links=tcpip(Host=<sql_anywhere_host_name>);CharSet=UTF8; # Gatekeeper (SQL Anywhere)
- odbc_connection_string: Server=<host_name>;Database=<database_name>;Uid=<mssql_server_username>;Pwd=<mssql_server_password>; # SQL Server
sftp_username - Your district domain, which is also your district's SFTP username on the upload host (upload.iepanywhere.com). This command must be specified exactly once.
- sftp_username: <domain> # syntax
- sftp_username: walnut.k12.oh.us # example
sftp_host_public_key_md5 - md5 hash of SameGoal SFTP server's public key. This field is for security purposes and should never be changed. This command must be specified exactly once.
- sftp_host_public_key_md5: a12d727365de9d232663438bc9070876 # never change this
sftp_public_key_file - The relative path to your public key file. This value defaults to certs\id_rsa.pub. Using this command is only necessary when you have a non-standard named public key file, or if a single install of sg-agent is uploading files for several different districts (eg: at an ITC). This command is commonly used with the -config flag. This command can be specified zero or one times.
- sftp_public_key_file: <public_key_file> # syntax
- sftp_public_key_file: certs\walnut.k12.oh.us-id_rsa.pub # example
sftp_private_key_file - The relative path to your private key file. This value defaults to certs\id_rsa. Using this command is only necessary when you have a non-standard named private key file, or if a single install of sg-agent is uploading files for several different districts (eg: at an ITC). This command is commonly used with the -config flag. This command can be specified zero or one times.
- sftp_private_key_file: <private_key_file> # syntax
- sftp_private_key_file: certs\walnut.k12.oh.us-id_rsa # example
tables - A space separated list of tables to upload. Information will be extracted from each table by running a query of the form: "SELECT * FROM
". Then SG-Agent will create a CSV file using the database column names in the CSV header line and putting one line in the CSV file for each row in the database. The filename for the generated CSV file will be the name of the table that was extracted. This command may be specified zero or one times. If this command is specified one time, the odbc_connection_string command is also required. For example:
- tables: <table 1> ... <table N> # syntax
- tables: Students Guardians # uploads two files with information from the Students and Guardians tables (students.csv and guardians.csv)
sql - Create a new CSV file and populate it with the result set from the specified SQL statement. This command can be specified zero more times (one time per SQL statement you wish to run). If this command is specified one or more times, the odbc_connection_string command is also required. NOTE: This command is rarely used (if possible, use "tables" instead).
- sql: <csv_file_name> <sql_query> # syntax
- sql: "SELECT * FROM Students WHERE Enrolled = 1;" students.csv # example
files - Upload the specified file(s) for import by SameGoal. Use this option if you wish to create CSV file(s) with an external program/script but upload them using SG-Agent. This command can be specified zero or one times. For example:
- files: <fully_qualified_csv_file 1> ... <fully_qualified_csv_file N> # syntax
- files: C:\students.csv C:\guardians.csv # uploads students.csv, guardians.csv
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:
- C:\>exit 0
- C:\>exit 1
To check for a non-zero return code use IF %ERRORLEVEL% NEQ 0 .... Example:
- C:\sg-agent>IF %ERRORLEVEL% NEQ 0 ECHO failure
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:
- C:\sg-agent>sg-agent.exe -help
SG-Agent can be run with multiple different config files using the -config flag. Example:
- C:\sg-agent>sg-agent.exe -config=walnut.k12.oh.us_config.txt