From a55b58732169b855d09360f16a67d1b9cdb7dc96 Mon Sep 17 00:00:00 2001 From: Zachary Vance Date: Mon, 19 Jun 2017 17:17:15 -0700 Subject: [PATCH] Check that burn::ghtorrent is running --- cgi-bin/service.status.d/ghtorrent downloader | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 cgi-bin/service.status.d/ghtorrent downloader 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 -- 2.47.3