| Name | Required | Type | Default | Description |
|---|---|---|---|---|
SERVER_URL | Yes | string | '' | The URL to the Rest API of EdgeOS instance, e.g. https://router.example.com:8443 |
USERNAME | Yes | string | '' | Username to log in as |
PASSWORD_LOCATION | Yes | string | '' | Path to a file containing only the password |
BACKUP_BASE_DIR | Yes | string | '' | Location to store backups, will create sub directories and files, user must have write access. |
COOKIE_JAR_LOCATION | Yes | string | '' | Filepath of where to store the temporary file containing session cookies related to the login. File will be emptied at start and end of script. |
MAX_FILES | No | number | 0 | Number of files to save, when limit is met will remove oldest files first. If set to 0 no (valid) files will be removed. |
INSECURE_HTTPS | No | boolean | false | If true the requests made will not validate certificate errors, useful for self-signed certificates. |
MIN_FILE_SIZE | No | number | 1024 | If the resulting backup file is smaller than this size (Bytes) the file will be marked as invalid. This is a naive check to make sure that the backup request was successful, since some invalid requests will still generate (a small) invalid file, that is not working. |
INVALID_FILE_NAME_PREFIX | No | string | invalid. | If the backup is identified as invalid, it will rename the file with this prefix. |
CLEAN_OLD_INVALID_FILES | No | boolean | true | If true the script will remove previously invalid files. If current backup request is identified as invalid it will be kept until next run of the script to allow for some debugging/monitoring. |
version: "3.9"
services:
edgeos-backup:
image: johnlindahl/edgeos-backup:latest
environment:
- SERVER_URL=https://<hostname-or-ip>
- USERNAME=<your-user>
- PASSWORD_LOCATION=/run/secrets/my_password
- BACKUP_BASE_DIR=/backups # This must match right hand side of a volume.
- COOKIE_JAR_LOCATION=/tmp/.cookie-jar
- MAX_FILES=5
- MIN_FILE_SIZE=1024
- INSECURE_HTTPS=true # Convenient if using self-signed cert, NOT PRODUCTION GRADE setting
- INVALID_FILE_NAME_PREFIX=invalid.
- CLEAN_OLD_INVALID_FILES=true
volumes:
- ./backups:/backups # Right hand side of the volume must match BACKUP_BASE_DIR env var.
secrets:
- my_password
secrets:
my_password:
file: ./my_password.txt
docker run -d \
--name=edgeos-backup \
-e SERVER_URL=https://<hostname-or-ip> \
-e USERNAME=<your-user> \
-e PASSWORD_LOCATION=/my_password \
-e BACKUP_BASE_DIR=/backups \
-e COOKIE_JAR_LOCATION=/tmp/.cookie-jar \
-e MAX_FILES=5 \
-e MIN_FILE_SIZE=1024 \
-e INSECURE_HTTPS=true \
-e INVALID_FILE_NAME_PREFIX=invalid. \
-e CLEAN_OLD_INVALID_FILES=true \
-v /path/to/backups:/backups \
-v /path/to/passwordfile:/my_password \
johnlindahl/edgeos-backup:latest
Content type
Image
Digest
sha256:bcc8e3e57…
Size
58.3 MB
Last updated
over 3 years ago
docker pull johnlindahl/edgeos-backup