Skip to content

Commit

Permalink
Space Deamon (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
morsecodist authored May 10, 2022
1 parent 79796cb commit bd95212
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,17 @@ mount /dev/md0 MINIWDL_DIR

cloud-init-per once docker_options echo '{"data-root": "MINIWDL_DIR/docker"}' >> /etc/docker/daemon.json

##############################################
# Set up a job to terminate the instance if it becomes full
##############################################

echo '#!/bin/bash' > /bin/space-check
echo '[[ $(df MINIWDL_DIR --output=avail |tail -n1) -lt 1000000 ]] && poweroff; echo system terminated due to full drive >> /dev/stderr' >> /bin/space-check
chmod +x /bin/space-check

crontab -l > /tmp/mycron
echo "* * * * * /bin/space-check" > /tmp/mycron
crontab /tmp/mycron
rm /tmp/mycron

--==MYBOUNDARY==--
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.21.0-beta
v0.21.1-beta

0 comments on commit bd95212

Please sign in to comment.