From 1f81b42ce2cf0c7517609bd6d5fa941a4bc01233 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 18 Dec 2010 12:41:34 +0100 Subject: Remove old files from the cleanup dirs --- cron-jobs/ftpdir-cleanup | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cron-jobs/ftpdir-cleanup') diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup index fe49706..bd2d340 100755 --- a/cron-jobs/ftpdir-cleanup +++ b/cron-jobs/ftpdir-cleanup @@ -95,6 +95,14 @@ for repo in ${PKGREPOS[@]}; do fi done +old_pkgs=($(find ${CLEANUP_DESTDIR} -type f -mtime +${CLEANUP_KEEP} -printf '%f\n')) +if [ ${#old_pkgs[@]} -ge 1 ]; then + msg "Removing old packages from the cleanup directory..." + for old_pkg in ${old_pkgs[@]}; do + msg2 "${old_pkg}" + ${CLEANUP_DRYRUN} || rm -f "${CLEANUP_DESTDIR}/${old_pkg}" + done +fi for repo in ${PKGREPOS[@]}; do for arch in ${ARCHES[@]}; do -- cgit v1.2.3-2-g168b