Description #
The docker exec
source uses the
docker exec
command to execute one or more commands and
capture the standard output as a file to be backed up.
Configuration #
{
"sources": {
"name": "my-docker-exec-source",
"type": "DOCKER_EXEC",
"disabled": false,
"container": "compassionate_darwin",
"commands": [
{
"file": "out.sql",
"command": [
"sh",
"-c",
"mysqldump -u root -p$MYSQL_ROOT_PASSWORD --all-databases 2>/dev/null"
]
}
],
"remotes": [
"my-remote",
{
// ...
}
],
"transformers": [
// ...
]
}
}
Available configuration options #
name #
- required
The name of the source. This has to be a valid identifier.
type #
- required
- constant
A constant that tells the engine what kind of source this object is. This must be set to "DOCKER_EXEC"
.
container #
- required
- template enabled
A string that can identify a container (name or partial container ID). Sourcing will stop if a container cannot be found.
commands #
- required (min 1 item)
An array of commands to be run using docker exec
.
commands[].file #
- required
- template enabled
The output file path of a respective command. The path can contain multiple directory levels.
commands[].command #
- required (min 1 item)
- template enabled
An array of command and arguments to be passed to docker exec
.
disabled #
- default value
Whether to ignore this source during the backup process. Defaults to false
.
remotes #
- default value
An array of remote identifiers, or inline configurations. If using an identifier, a remote with the respective name must exist in the root configuration. Defaults to no remotes.
See remotes for a list of available remotes.
transformers #
- default value
An array of transformer types, or inline configurations. Transformers will be executed in the order they are defined in the array. Defaults to no transformers.
See transformers for a list of available transformers.