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/sourceballs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cron-jobs/sourceballs') diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 85221a7..4048e2f 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -132,4 +132,13 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then done fi +old_pkgs=($(find ${SOURCE_CLEANUP_DESTDIR} -type f -mtime +${SOURCE_CLEANUP_KEEP} -printf '%f\n')) +if [ ${#old_pkgs[@]} -ge 1 ]; then + msg "Removing old source packages from the cleanup directory..." + for old_pkg in ${old_pkgs[@]}; do + msg2 "${old_pkg}" + ${SOURCE_CLEANUP_DRYRUN} || rm -f "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}" + done +fi + script_unlock -- cgit v1.2.3-24-g4f1b