Sign inSign up

kosdk/fileupdater

By kosdk

•Updated over 4 years ago

A container to download a set of files at continuous intervals.

Image
0

4.3K

kosdk/fileupdater repository overview

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.

⁠Environmental Variables

Bold denotes required Environment Variables.

NameTypeDescription
INTERVALintegerThe interval time in minutes. If 0 then only run once (default).
OUTPUTPATHstringThe output path in the container (default /fileoutput).
BEGINintegerThe time in HHMM UTC when to first start the script.
IGNORESSLbooleanIgnore SSL errors (invalid certificates).
CACERTstringFile location for the certificate to use for https connections.
URL1stringThe URL of the file to download.
NAME1stringThe name of the file for URL1.
URL2stringThe URL of the file to download.
NAME2stringThe 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 IGNORESSL and CACERT environment variables are provided then IGNORESSL takes precedence. Using IGNORESSL is not recommended. If you are using a self-signed or custom certificate authority then use the CACERT option with the root certificate path (must be volume mapped into the container).

⁠Examples

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

Tag summary

Content type

Image

Digest

Size

4.2 MB

Last updated

over 4 years ago

docker pull kosdk/fileupdater