diff options
author | Masaya Tojo <masaya@tojo.tokyo> | 2021-09-14 03:52:32 +0900 |
---|---|---|
committer | Masaya Tojo <masaya@tojo.tokyo> | 2021-09-14 03:52:32 +0900 |
commit | 1ad99d5b548aa5e2a4d6aca804ea54658ac977f7 (patch) | |
tree | 78ae65d206a4fe94709b6ce65e35e700dd085de4 | |
parent | 2c872a2b7c79b407dd20c577c45e72dcd05e397a (diff) |
check-backup-of-jupyter-notebook: Fix checking method.
-rwxr-xr-x | jobs/check-backup-of-jupyter-notebook.run | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/jobs/check-backup-of-jupyter-notebook.run b/jobs/check-backup-of-jupyter-notebook.run index 8cdc4a0..77eb8fe 100755 --- a/jobs/check-backup-of-jupyter-notebook.run +++ b/jobs/check-backup-of-jupyter-notebook.run @@ -6,5 +6,7 @@ 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 }' +# UTC の時刻で日付が同日の場合はバックアップに成功していると見做す +echo "$output" |\ + awk -v utc_today="$(TZ=UTC date "+%F")" \ + '$1 != utc_today { print "Failed!"; exit 1 }' |