From 8794727a6afefc62d755c5dc809eef02a8b19599 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 2 Oct 2022 12:57:49 +0200 Subject: [PATCH] 40-autodist-cleanold: sync with current build server --- etc/cron.daily/40-autodist-cleanold | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/etc/cron.daily/40-autodist-cleanold b/etc/cron.daily/40-autodist-cleanold index 80abfee..7194c26 100755 --- a/etc/cron.daily/40-autodist-cleanold +++ b/etc/cron.daily/40-autodist-cleanold @@ -2,12 +2,12 @@ [ -e /etc/autodist/config ] && . /etc/autodist/config [ -e /etc/sysconfig/autoport ] && . /etc/sysconfig/autoport -RPMS_CTIME_OLD="+14" -BUILD_CTIME_OLD="+14" -SOURCES_CTIME_OLD="+40" -SOURCES_ARCHIVES_CTIME_OLD="+14" -SOURCES_PATCH_CTIME_OLD="+730" -SRPMS_CTIME_OLD="+14" +RPMS_CTIME_OLD="+3" +BUILD_CTIME_OLD="+3" +SOURCES_CTIME_OLD="+7" +SOURCES_ARCHIVES_CTIME_OLD="+7" +SOURCES_PATCH_CTIME_OLD="+365" +SRPMS_CTIME_OLD="+3" TMP_CTIME_OLD="+2" function clean() { @@ -47,16 +47,18 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do [ -e /var/autoport/$a/var/autodist/RPM/RPMS/ ] && \ clean /var/autoport/$a/var/autodist [ -e /var/autoport/$a/var/tmp/autodist ] && \ - find /var/autoport/$a/var/tmp/autodist/ -mindepth 1 -maxdepth 1 -type f -mtime ${TMP_CTIME_OLD} -exec rm -rf {} \; - find /var/autoport/$a/tmp/ -mindepth 1 -maxdepth 1 -type f -mtime ${TMP_CTIME_OLD} -exec rm -rf {} \; + find /var/autoport/$a/var/tmp/autodist/ -mindepth 1 -maxdepth 1 -type f -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \; + find /var/autoport/$a/tmp/ -mindepth 1 -maxdepth 1 -type f -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \; + sudo -u ${AUTOPORT_CHROOT_USER[$i]} ccache -C elif [ "${AUTOPORT_UPDATE[$i]}" ]; then clean /var/autodist - find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -type f -mtime ${TMP_CTIME_OLD} -exec rm -rf {} \; + find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \; + sudo -u autodist ccache -C 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 fi - find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -type f -mtime ${TMP_CTIME_OLD} -exec rm -rf {} \; + find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \; fi done