From 9afdb96444eb39a28f648ea001a460a5e8d737d9 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Thu, 13 Nov 2014 14:29:50 +0100 Subject: [PATCH] 40-autodist-cleanold cron: minor adjustments --- etc/cron.daily/40-autodist-cleanold | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/etc/cron.daily/40-autodist-cleanold b/etc/cron.daily/40-autodist-cleanold index 01230b1..04a8444 100755 --- a/etc/cron.daily/40-autodist-cleanold +++ b/etc/cron.daily/40-autodist-cleanold @@ -11,13 +11,13 @@ function clean() { dir=$1 arch=$2 [ "$VERBOSE" ] && echo "Cleaning from base directory $dir..." - [ -e $dir/ ] && find $dir/ -maxdepth 1 -name "pipe\:\[*" -exec rm -f {} \; - [ -e $dir/RPM/SPECS/ ] && find $dir/RPM/SPECS/ -maxdepth 1 -type f -not -name "*.spec*" -exec rm -f {} \; - [ -e $dir/RPM/RPMS/$arch/ ] && find $dir/RPM/RPMS/$arch/ -maxdepth 1 -ctime ${RPMS_CTIME_OLD} -exec rm -f {} \; - [ -e $dir/RPM/RPMS/noarch/ ] && find $dir/RPM/RPMS/noarch/ -maxdepth 1 -ctime ${RPMS_CTIME_OLD} -exec rm -f {} \; - [ -e $dir/RPM/BUILD/ ] && find $dir/RPM/BUILD/ -maxdepth 1 -ctime ${BUILD_CTIME_OLD} -exec rm -rf {} \; - [ -e $dir/RPM/SOURCES/ ] && find $dir/RPM/SOURCES/ -maxdepth 1 -ctime ${SOURCES_CTIME_OLD} -a ! -name "*.patch" -exec rm -f {} \; - [ -e $dir/RPM/SRPMS/ ] && find $dir/RPM/SRPMS/ -maxdepth 1 -ctime ${SRPMS_CTIME_OLD} -exec rm -f {} \; + [ -e $dir/ ] && find $dir/ -mindepth 1 -maxdepth 1 -name "pipe\:\[*" -exec rm -f {} \; + [ -e $dir/RPM/SPECS/ ] && find $dir/RPM/SPECS/ -mindepth 1 -maxdepth 1 -type f -not -name "*.spec*" -exec rm -f {} \; + [ -e $dir/RPM/RPMS/$arch/ ] && find $dir/RPM/RPMS/$arch/ -mindepth 1 -maxdepth 1 -ctime ${RPMS_CTIME_OLD} -exec rm -f {} \; + [ -e $dir/RPM/RPMS/noarch/ ] && find $dir/RPM/RPMS/noarch/ -mindepth 1 -maxdepth 1 -ctime ${RPMS_CTIME_OLD} -exec rm -f {} \; + [ -e $dir/RPM/BUILD/ ] && find $dir/RPM/BUILD/ -mindepth 1 -maxdepth 1 -ctime ${BUILD_CTIME_OLD} -exec rm -rf {} \; + [ -e $dir/RPM/SOURCES/ ] && find $dir/RPM/SOURCES/ -mindepth 1 -maxdepth 1 -ctime ${SOURCES_CTIME_OLD} -a ! -name "*.patch" -exec rm -rf {} \; + [ -e $dir/RPM/SRPMS/ ] && find $dir/RPM/SRPMS/ -mindepth 1 -maxdepth 1 -ctime ${SRPMS_CTIME_OLD} -exec rm -f {} \; } for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do @@ -27,16 +27,16 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do [ -e /var/autoport/$a/var/autodist/RPM/RPMS/$arch ] && \ clean /var/autoport/$a/var/autodist ${AUTOPORT_ARCH[$i]} [ -e /var/autoport/$a/var/tmp/autodist ] && \ - find /var/autoport/$a/var/tmp/autodist/ -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \; - find /var/autoport/$a/tmp/ -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \; + find /var/autoport/$a/var/tmp/autodist/ -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \; + find /var/autoport/$a/tmp/ -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \; elif [ "${AUTOPORT_UPDATE[$i]}" ]; then clean /var/autodist ${AUTOPORT_ARCH[$i]} - find /var/autodist-tmp/ -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \; + find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \; elif [ "${AUTOPORT_NATIVE[$i]}" -a "${AUTOPORT_CHROOT_USER[$i]}" ]; then WORKINGHOME=`getent passwd ${AUTOPORT_CHROOT_USER[$i]} | cut -d: -f6` if [ -e $WORKINGHOME ]; then clean $WORKINGHOME ${AUTOPORT_ARCH[$i]} fi - find /var/autodist-tmp/ -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \; + find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \; fi done