ae6f549766
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/819300 Depends-On: https://review.opendev.org/c/openstack/ansible-role-systemd_service/+/819298 Change-Id: I0fb662cc3fe241bf3934306b7ee8a3c8fdbcf747
16 lines
496 B
Django/Jinja
16 lines
496 B
Django/Jinja
#!/bin/bash
|
|
|
|
# If the disabled file is present, don't allow the script
|
|
# to run unless it is forced.
|
|
if [ -e "/var/tmp/zun-docker-cleanup.disabled" ] && [ "$1" != "--force" ]; then
|
|
echo "Timed cleanup of Docker data is disabled"
|
|
echo "To force a cleanup, re-run this script with '--force'"
|
|
exit 0
|
|
fi
|
|
|
|
# Clear dangling images from Docker
|
|
docker image prune -f
|
|
|
|
# Clear old images from Zun cache directory
|
|
find {{ zun_system_home_folder }}/images -amin +1440 -type f -exec rm -fv {} \;
|