A container to download a set of files at continuous intervals.
4.3K
Download a list of files continuously at a specific interval. View Git Repository.
I use this container to download static images of graphs generated using Grafana and Grafana Image Renderer at set intervals as it takes 5+ seconds to render each chart image on a Raspberry Pi 3.
Bold denotes required Environment Variables.
| Name | Type | Description |
|---|---|---|
| INTERVAL | integer | The interval time in minutes. If 0 then only run once (default). |
| OUTPUTPATH | string | The output path in the container (default /fileoutput). |
| BEGIN | integer | The time in HHMM UTC when to first start the script. |
| IGNORESSL | boolean | Ignore SSL errors (invalid certificates). |
| CACERT | string | File location for the certificate to use for https connections. |
| URL1 | string | The URL of the file to download. |
| NAME1 | string | The name of the file for URL1. |
| URL2 | string | The URL of the file to download. |
| NAME2 | string | The name of the file for URL2. |
You can provide multiple files and names using URL2, NAME2, URL3, NAME3 and so on. If a file doesn't have a NAME set then the file name provided by the remote server will be used.
You can suffix _FILE to the end of any environment variable to set the variable from a file (ie URL1_FILE).
If
IGNORESSLandCACERTenvironment variables are provided thenIGNORESSLtakes precedence. UsingIGNORESSLis not recommended. If you are using a self-signed or custom certificate authority then use theCACERToption with the root certificate path (must be volume mapped into the container).
Download two images every 5 minutes and name them image1.png and image 2.png in the host folder /var/images:
docker run -d \
--name ImageUpdater \
-e INTERVAL=5 \
-e URL1=http://example.com/files/1.png \
-e URL2=http://example.com/files/image.png \
-e NAME1=image1.png \
-e NAME2=image\ 2.png \
--mount type=bind,source=/var/images,target=/fileoutput \
kosdk/fileupdater
Download a image from a https server with a self-generated root ca every 2 hours:
docker run -d \
-e INTERVAL=120 \
-e URL1=https://example.org/sslimage.png \
-e CACERT=/certs/ca.pem \
--mount type=bind,source=/var/images,target=/fileoutput \
--mount type=bind,source=/certs,target=/certs,readonly \
kosdk/fileupdater
Download a file once
docker run -d \
-e URL1=https://example.com/file.pdf \
--mount type=bind,source=/home/user,target=/fileoutput \
kosdk/fileupdater
Download file every day at 12 pm UTC
docker run -d \
-e INTERVAL=1440 \
-e BEGIN=1200 \
-e URL1=http://example.net/dailyupdate.zip \
--mount type=bind,source=/home/update,target=/fileoutput \
kosdk/fileupdater
Content type
Image
Digest
Size
4.2 MB
Last updated
over 4 years ago
docker pull kosdk/fileupdater