From 7c59acba5699c9c58090a7a738669669a7307023 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 21 Aug 2021 23:14:26 +0100 Subject: gentoo resync : 21.08.2021 --- app-admin/tmpwatch/files/tmpwatch.cron | 40 ++++++++++++++++------------------ 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'app-admin/tmpwatch/files') diff --git a/app-admin/tmpwatch/files/tmpwatch.cron b/app-admin/tmpwatch/files/tmpwatch.cron index 806b1453e552..d35a590379d7 100644 --- a/app-admin/tmpwatch/files/tmpwatch.cron +++ b/app-admin/tmpwatch/files/tmpwatch.cron @@ -1,47 +1,45 @@ #!/bin/sh -# vim: ft=sh + +PATH="/usr/sbin:/usr/bin:/sbin:/bin" # This cron script contains several (commented out) examples. You may use # them as is, by uncommenting them, or modify them to suit your needs. Read # tmpwatch(8) for more information on tmpwatch parameters. -### Variables ### - -TMPWATCH="/usr/sbin/tmpwatch" -#PORTAGE_TMPDIR="$(portageq envvar PORTAGE_TMPDIR)/portage" -#PORTAGE_LOGDIR="$(portageq envvar PORT_LOGDIR)" -#DISTDIR="$(portageq distdir)" - ### EXAMPLES ### # NOTE: if you have noatime in /etc/fstab for any partitions you plan on # running tmpwatch on, you should obviously change any of the examples that # use atime (-u|--atime). Those that don't specify anything, default to -# atime. - -# NOTE2: the time value is in HOURS! +# atime. Be aware that the time value is in HOURS! # Delete everything in /tmp that haven't been accessed in a week (>=168 hrs). # -# if [[ -d /tmp ]]; then -# ${TMPWATCH} --atime 168 /tmp +# if [ -d /tmp ]; then +# tmpwatch --atime 168 /tmp # fi # Delete everything in PORTAGE_TMPDIR that hasn't been modified in 2 weeks. # -# if [[ -d ${PORTAGE_TMPDIR:-/var/tmp/portage} && -z $(/usr/bin/pgrep emerge) ]]; then -# ${TMPWATCH} --mtime --all 336 ${PORTAGE_TMPDIR:-/var/tmp/portage} +# if PORTAGE_TMPDIR=$(portageq envvar PORTAGE_TMPDIR) && +# [ -d "${PORTAGE_TMPDIR}/portage" ] && +# ! pgrep -x emerge >/dev/null +# then +# tmpwatch --mtime --all 336 "${PORTAGE_TMPDIR}/portage" # fi # Delete everything in DISTDIR that hasn't been accessed in 6 months (going -# by 30 day months) +# by 30 day months). # -# if [[ -d ${DISTDIR:-/usr/portage/distfiles} ]]; then -# ${TMPWATCH} --atime --fuser 4320 ${DISTDIR:-/usr/portage/distfiles} +# if DISTDIR=$(portageq distdir) && [ -d "${DISTDIR}" ]; then +# tmpwatch --atime --fuser 4320 "${DISTDIR}" # fi -# Delete everything in PORTAGE_LOGDIR that hasn't been accessed in 4 weeks +# Delete everything in PORTAGE_LOGDIR that hasn't been accessed in 4 weeks. # -# if [[ -d ${PORTAGE_LOGDIR:-/var/log/portage} ]]; then -# ${TMPWATCH} --atime 772 ${PORTAGE_LOGDIR:-/var/log/portage} +# if { PORTAGE_LOGDIR=$(portageq envvar PORTAGE_LOGDIR) || +# PORTAGE_LOGDIR=$(portageq envvar PORT_LOGDIR); } && +# [ -d "${PORTAGE_LOGDIR}" ] +# then +# tmpwatch --atime 772 "${PORTAGE_LOGDIR}" # fi -- cgit v1.2.3