Created
July 14, 2018 15:40
-
-
Save sdkks/1cc7f9dff558092accbb8eb9993b6c21 to your computer and use it in GitHub Desktop.
Vacuum journalctl of nodes in your inventory
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
#!/usr/bin/env bash | |
exitCode(){ | |
case $1 in | |
0) | |
echo "Completed with success" | |
;; | |
*) | |
echo "Exited with failure: $1" | |
;; | |
esac | |
} | |
for NODE in node{1..4}; do | |
echo "Vacuuming on $NODE" | |
ssh $NODE sudo journalctl --vacuum-time=6h | |
exitCode $? | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment