Skip to content

Instantly share code, notes, and snippets.

@shsteven
Created October 17, 2022 02:16
Show Gist options
  • Save shsteven/c74e7e8e7261b3e1656f30823e10ad2b to your computer and use it in GitHub Desktop.
Save shsteven/c74e7e8e7261b3e1656f30823e10ad2b to your computer and use it in GitHub Desktop.
Crontab Docker Pruning
# See https://askubuntu.com/questions/440821/execute-script-when-disk-space-is-low
@daily sh -c "if [ $(df / --output='pcent' | grep -o "[0-9]*") -gt 90 ]; then docker system prune -af; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment