Command line usage

The elements_http_upload.__main__ module can be used from the command line via

    python -m elements_http_upload [options] [arguments]

or via

    elements-http-upload [options] [arguments]
usage: elements-http-upload [-h] -H HOST -t API_TOKEN [--no-verify]
                            [-c CHUNK_SIZE] [-n CONCURRENT_UPLOADS] [-v] [-s]
                            [-d TARGET_ROOT] [-r]
                            LOCAL-SRC[:REMOTE-DEST] [LOCAL-SRC[:REMOTE-DEST]
                            ...]

Connection Settings

-H, --host

The url of the elements instance in the form of https://sub.domain

-t, --api-token

The API token to use for the requests

Default: ````

--no-verify

Skip the verification of SSL certificates in HTTPS requests.

Default: False

Upload settings

-c, --chunk-size

The chunk size to use within one single request.

Default: 10485760

-n, --concurrent-uploads

The number of parallel upload threads.

Default: 5

Verbosity options

-v, --verbose

Enable debug mode and be more verbose

Default: False

-s, --silent

Do not provide progress information.

Default: False

File options

LOCAL-SRC[:REMOTE-DEST]

The files or directories to upload. LOCAL-SRC is the local file (or directory if --recursive is set), REMOTE-DEST is the destination on the remote system. If REMOTE-DEST is not set, --target-root must be specified. If REMOTE-DEST is set, it needs to be a relative path to the given --target-root, or and absolute path if --target-root is not specified.

-d, --target-root

Root folder on the remote system, by default None. If this is set, all target paths in the uploads need to be relative and will be appended to the target_root. If this is not set, all destination paths in the uploads need to be absolute paths.

-r, --recursive

If true, upload all files in a directory (symbolic links are ignored for directories, but not for files)

Default: False

Environment variables

Instead of specifying the connection and upload settings (Host, API token) via the command line, you can also set environment variables prefixed with elements_upload_, i.e. elements_upload_host, elements_upload_api_token, etc. Upper and lowercase variable names are possible. The following environment variables are available:

  • elements_http_upload_host

  • elements_http_upload_api_token

  • elements_http_upload_skip_certificate_validation

  • elements_http_upload_chunk_size

  • elements_http_upload_concurrent_uploads

  • elements_http_upload_silent

  • elements_http_upload_verbose

Examples

For examples, please visit https://elements-http-upload.readthedocs.io/en/latest/usage.html