logoalt Hacker News

apawloskitoday at 3:26 PM0 repliesview on HN

For expensive GPU instances I have a crontab one-liner that shuts the node down after 2 hours if I don't touch an override file (/var/run/keepalive).

/5 * * * [ -f /var/run/keepalive ] && [ $(( $(date +\%s) - $(stat -c \%Y /var/run/keepalive) )) -gt 7200 ] && shutdown -h now