Created
June 16, 2017 14:52
-
-
Save mnewt/ae302ec91055529a154eefbcc37769eb to your computer and use it in GitHub Desktop.
Download a file iff URL's HTTP If-Modified-Since header is more recent than the local file timestamp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Download a file iff URL's HTTP If-Modified-Since header is more recent than | |
# the local file timestamp | |
url="$1" | |
file="$2" | |
shift 2 | |
curl -z "$file" -Lo "$file" "$url" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment