github.com/Jimdo/download-watch


Properties

Last built 5 months ago using go version go1.7.3 linux/amd64 and 132 seconds of time

Downloads
Filename
File Size
 
download-watch_master_darwin-386.zip
1.9MiB
download-watch_master_darwin-amd64.zip
2.0MiB
download-watch_master_linux-386.zip
1.9MiB
download-watch_master_linux-amd64.zip
2.0MiB
download-watch_master_linux-arm.zip
1.8MiB
download-watch_master_windows-386.zip
1.8MiB
download-watch_master_windows-amd64.zip
2.0MiB
Project-Readme for this version

Jimdo / download-watch

download-watch is a utility to watch on URLs and save their output locally. Also it’s possible to execute commands when files changed. For example you could reload a webserver when a new configuration was written.

It can save the file - periodically no matter what - when it changed (ETag aware) so that it’s not written if the server says nothing changed - when the SHA256 hash doesn’t match locally but on the server

Configuration file

---
# Optional: Command to use for executing the success_command, the command will get appended as one argument (default: ["/bin/bash", "-c"])
command_shell: ["/bin/bash", "-c"]
files:
  # Key for the map is the target file path
  /etc/myconfig.conf:
    # Optional: Specify user:pass for the basic authentication
    basic_auth: myuser:mypass
    # Optional: How long to wait for the file to finish downloading (default: 30s)
    timeout: 30s
    # Required: How long to wait between two downloads
    fetch_interval: 5m
    # Optional: Ignore ETag sent by server, refresh file even if it's the same
    ignore_etag: false
    # Optional: Check existing file / downloaded file against checksum
    sha256: e84712238709398f6d349dc2250b0efca4b72d8c2bfb7b74339d30ba94056b14
    # Required: URL to fetch the file from
    url: https://example.com/myconfig.conf
    # Optional: Command to execute every time the file was written successfully
    success_command: /etc/init.d/apache2 reload
  /etc/myotherconfig.conf:
    url: https://example.com/myotherconfig.conf
    fetch_interval: 1h