Add soscmd-prune-dockerlogs command

This commit is contained in:
The StarOpenSource Project 2024-04-13 23:35:27 +02:00
parent 7d76f6b24f
commit 7b6de3c891
2 changed files with 13 additions and 0 deletions

View file

@ -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
View 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