]> git.za3k.com Git - za3k.git/commitdiff
Check that burn::ghtorrent is running
authorZachary Vance <za3k@za3k.com>
Tue, 20 Jun 2017 00:17:15 +0000 (17:17 -0700)
committerZachary Vance <za3k@za3k.com>
Tue, 20 Jun 2017 00:17:15 +0000 (17:17 -0700)
cgi-bin/service.status.d/ghtorrent downloader [new file with mode: 0644]

diff --git a/cgi-bin/service.status.d/ghtorrent downloader b/cgi-bin/service.status.d/ghtorrent downloader
new file mode 100644 (file)
index 0000000..360f361
--- /dev/null
@@ -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