diff options
author | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2015-04-21 17:32:07 +0200 |
---|---|---|
committer | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2015-04-21 17:32:07 +0200 |
commit | e505d27bf36a7377c40ce1199490350ad57a522e (patch) | |
tree | 6a615bafb023e296d97f9788807803cd3532384e | |
parent | af1432b44ffd859c33d0aaedf070c2d3b745cb00 (diff) | |
download | bcfg2-tools-e505d27bf36a7377c40ce1199490350ad57a522e.tar.gz bcfg2-tools-e505d27bf36a7377c40ce1199490350ad57a522e.tar.bz2 bcfg2-tools-e505d27bf36a7377c40ce1199490350ad57a522e.zip |
check-hosts: Cleanup removed hosts
Remove orphaned stale hosts state files for removed hosts.
-rwxr-xr-x | check-hosts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/check-hosts b/check-hosts index e629bab..6c7dcfd 100755 --- a/check-hosts +++ b/check-hosts @@ -40,8 +40,8 @@ get_stale_once() { ) done - comm -13 <(get_stale | sort) <(get_all | sort) | while read host; do - STALE_FILE="${STALE_DIR}/${host}" + comm -23 <(ls -1 ${STALE_DIR}/ | sort) <(get_all | sort) | while read file; do + STALE_FILE="${STALE_DIR}/${file}" test -f "${STALE_FILE}" && rm -f "${STALE_FILE}" done } |