soscmd/soscmd-prune-dockerlogs

13 lines
297 B
Text
Raw Normal View History

2024-04-13 23:35:27 +02:00
#!/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