While helping you trouble-shoot docker or application issues, the SSDT may ask you to send a file to the SSDT from your docker host.   The SSDT Utils contains a script called /ssdt/scripts/send.sh which will transfer a file securely to an SSDT controlled server via HTTPS.  The init.sh script (if sourced in .bashrc or linked in profile.d) provides a send2ssdt alias to easily invoke the script.  

The script requires a file name parameter relative to the current working directory. The file must in contained in, or below, the current working directory. Alternatively, the file may be specified as a single dash (-) to read from standard input.

 An optional second parameter may be specified to indicate the name, or short description, of the file (no spaces or special characters). If not specified, the name parameter defaults to the basename of the current directory. 

When sending a backup, do not use the optional second parameter.  Backups are already uniquely named.  In order for the restore process to work properly, the original backup name is required.


/ssdt/scripts/send.sh {file} [name]
# or
send2ssdt {file} [name]


The script does not notify the SSDT that a file has been sent. Therefore, you should communicate via other means when you send a file.

When transmitted to the SSDT, the file will be given a name prefixed by your docker host name and suffixed with a time stamp to ensure uniqueness. Note for backups, the file will be transmitted with the existing name, as they are already unique.

Examples:

To send the log file from all containers, use:

#  docker-compose logs | /ssdt/scripts/send.sh -

To send the log from a single container (such as usaspp or uspsapp):

#  docker-compose logs usasapp | /ssdt/scripts/send.sh -

To send a log file from the current directory:

/ssdt/scripts/send.sh usasimport.log
# or:
send2ssdt usasimport.log

To send an existing backup:

send2ssdt backup/irnnameofdistrict-usasdb.2016-03-11-15-20-10.backup.gz 


Do not use the second parameter to indicate a different name for the upload for the backup.

To send the output of a command

 
/ssdt/scripts/info.sh | send2ssdt -

Technical Note:

The script uses the ssdt-utils image to execute the curl command to post the file to the SSDT's upload server. Since curl is running inside a temporary container, the file to be sent must be within or below your current working directory.  It also means you do not have to have curl installed on your server.

This web site is "write only" so only SSDT personnel can access the transmitted files.

Related articles


Related issues