Created
November 30, 2020 02:59
-
-
Save ettingshausen/dbb675a3f5b33e7438fdc8e36964e4de to your computer and use it in GitHub Desktop.
clean docker container logs
This file contains hidden or 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/sh | |
echo "======== start clean docker containers logs ========" | |
logs=$(find /var/lib/docker/containers/ -name *-json.log) | |
for log in $logs | |
do | |
echo "clean logs : $log" | |
cat /dev/null > $log | |
done | |
echo "======== end clean docker containers logs ========" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment