Compare commits
2 Commits
befeedcacb
...
f07eb9fa12
Author | SHA1 | Date | |
---|---|---|---|
f07eb9fa12 | |||
f2d90e4e74 |
14
docker-clear-log.sh
Normal file
14
docker-clear-log.sh
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
if [[ -z $1 ]]; then
|
||||
echo "No container specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$(docker ps -aq -f name=^/${1}$ 2> /dev/null)" == "" ]]; then
|
||||
echo "Container \"$1\" does not exist, exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log=$(docker inspect -f '{{.LogPath}}' $1 2> /dev/null)
|
||||
truncate -s 0 $log
|
Loading…
Reference in New Issue
Block a user