Add housekeeping task (docker image cleanup)

This commit is contained in:
Martin Lablans 2022-10-20 16:55:05 +02:00
parent 17c6a2b0e0
commit 2b78835872
1 changed files with 11 additions and 0 deletions

View File

@ -1,6 +1,17 @@
#!/bin/bash #!/bin/bash
source lib/functions.sh source lib/functions.sh
AUTO_HOUSEKEEPING=${AUTO_HOUSEKEEPING:-true}
if [ "$AUTO_HOUSEKEEPING" == "true" ]; then
A="Performing automatic maintenance: Cleaning docker images."
hc_send log "$A"
log INFO "$A"
docker system prune -a -f
else
log WARN "Automatic housekeeping disabled (variable AUTO_HOUSEKEEPING != \"true\")"
fi
hc_send log "Checking for bridgehead updates ..." hc_send log "Checking for bridgehead updates ..."
CONFFILE=/etc/bridgehead/$1.conf CONFFILE=/etc/bridgehead/$1.conf