aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2021-09-14 00:17:32 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2021-09-14 00:25:51 +0900
commita73ad8b9e36026ec1c3fa3b4e848f77fc0f7b6f0 (patch)
tree084a733425d990c482518e080af0739626acc8e9
parentc21f04edc1abbfe1e4b0fb3c0961afaa4d6554c7 (diff)
check-notebooks-backup: Add.
-rwxr-xr-xjobs/check-notebooks-backup.run9
1 files changed, 9 insertions, 0 deletions
diff --git a/jobs/check-notebooks-backup.run b/jobs/check-notebooks-backup.run
new file mode 100755
index 0000000..190db3e
--- /dev/null
+++ b/jobs/check-notebooks-backup.run
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+todays_backup="s3://qkbackup/notebooks/$(date "+%Y/%m/%d")"
+echo "Check $todays_backup."
+output="$(guix environment --ad-hoc python2-s3cmd -- s3cmd ls "$todays_backup")"
+
+# 容量が 1000 以下の場合はバックアップに失敗したと見做す
+echo "$output" | awk '!$3 || $3 <= 1000 { exit 1 }'