Created
September 21, 2016 08:48
-
-
Save suside/8b262fb3fd65b2235d2b8ca6920ee68a to your computer and use it in GitHub Desktop.
journald logs disk usage group by/per unit/container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "***************************** CONTAINERS *****************************" | |
for F in `journalctl -F CONTAINER_NAME` | |
do | |
echo "$(journalctl CONTAINER_NAME=$F | wc -c | awk '{ print $1/1024/1024"MB" }') $F" | |
done | sort -nrk 1 | column -c 2 | |
echo "***************************** UNITS *****************************" | |
for F in `journalctl -F UNIT` | |
do | |
echo "$(journalctl UNIT=$F | wc -c | awk '{ print $1/1024/1024"MB" }') $F" | |
done | sort -nrk 1 | column -c 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment