Last active
March 26, 2021 12:51
-
-
Save avanavana/0c6aa71c5c9a6c69d2e88ba4b6b6d084 to your computer and use it in GitHub Desktop.
Checks timezonedb.com to see if timezone sql and csv db files have been updated today, and downloads them both if they have. Meant to be run daily with crontab.
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
#!/bin/bash | |
# add to crontab with something like '* 0 * * * /path/to/tzdb.sh &>/dev/null' | |
# change the -o option's parameter to save the files in a different dir on your machine | |
date=`date "+%Y-%m-%d"` | |
if [[ ! `curl -s https://timezonedb.com/date.txt` < "$date" ]]; then | |
curl -s "https://timezonedb.com/files/timezonedb.{csv,sql}.zip" -o "tzdb-${date}-#1.zip" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment