From: Zachary Vance Date: Tue, 20 Jun 2017 00:17:15 +0000 (-0700) Subject: Check that burn::ghtorrent is running X-Git-Url: https://git.za3k.com/?a=commitdiff_plain;h=a55b58732169b855d09360f16a67d1b9cdb7dc96;p=za3k.git Check that burn::ghtorrent is running --- diff --git a/cgi-bin/service.status.d/ghtorrent downloader b/cgi-bin/service.status.d/ghtorrent downloader new file mode 100644 index 0000000..360f361 --- /dev/null +++ b/cgi-bin/service.status.d/ghtorrent downloader @@ -0,0 +1,8 @@ +DOWNLOAD=$(rsync -l burn.za3k.com::ghtorrent | awk '{print $3}' | sort | tail -n1) +echo "Last file downloaded: $DOWNLOAD" +EXPECTED=$(date +"%Y/%m/%d") +[ "${DOWNLOAD}" = "${EXPECTED}" ] && exit 0 +EXPECTED=$(date --date="yesterday" +"%Y/%m/%d") +[ "${DOWNLOAD}" = "${EXPECTED}" ] && exit 0 +EXPECTED=$(date --date="2 days ago" +"%Y/%m/%d") +[ "${DOWNLOAD}" = "${EXPECTED}" ] && exit 0