diff options
Diffstat (limited to 'jobs/check-backup-of-jupyter-notebook.run')
-rwxr-xr-x | jobs/check-backup-of-jupyter-notebook.run | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/jobs/check-backup-of-jupyter-notebook.run b/jobs/check-backup-of-jupyter-notebook.run new file mode 100755 index 0000000..8cdc4a0 --- /dev/null +++ b/jobs/check-backup-of-jupyter-notebook.run @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -euo pipefail + +todays_backup="s3://qkbackup/jupyter-notebook/$(date "+%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 }' |