soscmd/soscmd-prune-dockerlogs
2024-04-13 23:35:27 +02:00

12 lines
297 B
Bash
Executable file

#!/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