sunetdrive/templates/multinode/prune.erb.sh

10 lines
279 B
Bash
Raw Permalink Normal View History

2023-02-13 09:44:56 +00:00
#!/bin/bash
if [[ $(df --output=ipcent /var/lib/docker/ | tail -1 | sed 's/[ %]//g') -gt 50 ]]; then
touch /etc/no-automatic-cosmos
systemctl stop docker sunet-*.service
#docker system prune -af --volumes
rm -rf /var/lib/docker
rm /etc/no-automatic-cosmos
safer_reboot
fi