summaryrefslogtreecommitdiffstats
path: root/cron-jobs
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-12-18 12:41:34 +0100
committerPierre Schmitz <pierre@archlinux.de>2010-12-18 12:41:34 +0100
commit1f81b42ce2cf0c7517609bd6d5fa941a4bc01233 (patch)
treea8c18793b9a244046061739a866a92fd9d908d49 /cron-jobs
parentc736d21ae97cbd9e4f6b036029426f77f14fd063 (diff)
downloaddbscripts-1f81b42ce2cf0c7517609bd6d5fa941a4bc01233.tar.gz
dbscripts-1f81b42ce2cf0c7517609bd6d5fa941a4bc01233.tar.xz
Remove old files from the cleanup dirs
Diffstat (limited to 'cron-jobs')
-rwxr-xr-xcron-jobs/ftpdir-cleanup8
-rwxr-xr-xcron-jobs/sourceballs9
2 files changed, 17 insertions, 0 deletions
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
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