Created
October 14, 2016 14:54
-
-
Save vangie/70a73a6cfcd538e9bbc30f3e49c9e1fa to your computer and use it in GitHub Desktop.
clean docker container logs
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 | |
# sudo ./docker-logs-clean.sh container_name | |
logfile=$(docker inspect $1 | grep -G '"LogPath": "*"' | sed -e 's/.*"LogPath": "//g' | sed -e 's/",//g'); | |
echo "clean log file of container $1: $logfile" | |
truncate -s 0 $logfile | |
echo "done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment