From c041d498e9fd5be5d0ad8b545200a18194a907f3 Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Tue, 14 Sep 2021 00:48:25 +0900 Subject: check-backup-of-notebooks: Rename job. --- jobs/check-backup-of-notebooks.run | 10 ++++++++++ jobs/check-notebooks-backup.run | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) create mode 100755 jobs/check-backup-of-notebooks.run delete mode 100755 jobs/check-notebooks-backup.run diff --git a/jobs/check-backup-of-notebooks.run b/jobs/check-backup-of-notebooks.run new file mode 100755 index 0000000..56f7cb6 --- /dev/null +++ b/jobs/check-backup-of-notebooks.run @@ -0,0 +1,10 @@ +#!/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")" +echo "$output" + +# 出力がない、もしくは容量が 1000 以下の場合はバックアップに失敗したと見做す +echo "$output" | awk '!$3 || $3 <= 1000 { print "Failed!"; exit 1 }' diff --git a/jobs/check-notebooks-backup.run b/jobs/check-notebooks-backup.run deleted file mode 100755 index 56f7cb6..0000000 --- a/jobs/check-notebooks-backup.run +++ /dev/null @@ -1,10 +0,0 @@ -#!/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")" -echo "$output" - -# 出力がない、もしくは容量が 1000 以下の場合はバックアップに失敗したと見做す -echo "$output" | awk '!$3 || $3 <= 1000 { print "Failed!"; exit 1 }' -- cgit v1.2.3