cleanup tmpdir in janitor
This commit is contained in:
@@ -24,16 +24,6 @@ readonly containers=$(docker ps -qa)
|
||||
for container in $containers; do
|
||||
echo "Cleaning up $container"
|
||||
|
||||
if tmpdir=$(docker inspect --format='{{index .Volumes "/tmp"}}' $container); then
|
||||
echo -e "\tRemoving old files from $tmpdir"
|
||||
|
||||
if [[ $tmpdir == /home/yellowtent/data/docker/volumes/* ]]; then
|
||||
find $tmpdir -mtime +10 -exec rm -rf {} + # 10 days max. note we cannot use atime because this is not a tmpfs
|
||||
else
|
||||
echo -e "\tInternal error in script. /tmp is mounted at unexpected location $tmpdir"
|
||||
fi
|
||||
fi
|
||||
|
||||
if logdir=$(docker inspect --format='{{index .Volumes "/var/log"}}' $container); then
|
||||
echo -e "\tLogrotate files under $logdir"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user