Add soscmd-prune-dockerlogs command
This commit is contained in:
parent
7d76f6b24f
commit
7b6de3c891
2 changed files with 13 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
soscmd-prune-pacman
|
||||
soscmd-prune-docker
|
||||
soscmd-prune-dockerlogs
|
||||
echo ":: Pruned pacman and docker."
|
||||
|
|
12
soscmd-prune-dockerlogs
Executable file
12
soscmd-prune-dockerlogs
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
cd /var/lib/docker/containers
|
||||
for cont in *; do
|
||||
if [ -n "${SOSCMD_VERBOSE}" ]; then
|
||||
echo ":: Processing container \"${cont}\""
|
||||
fi
|
||||
if [ -f "${cont}/${cont}-json.log" ]; then
|
||||
echo ":: Cleaned container \"${cont}\""
|
||||
echo "" > "${cont}/${cont}-json.log"
|
||||
fi
|
||||
done
|
Loading…
Reference in a new issue