Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 54443 - tmpwatch ebuild should provide a reasonable cron entry
Summary: tmpwatch ebuild should provide a reasonable cron entry
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Aaron Walker (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-19 11:46 UTC by Janne Pikkarainen
Modified: 2005-05-08 04:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janne Pikkarainen 2004-06-19 11:46:04 UTC
It would be nice if tmpwatch ebuild could include a reasonable cron entry for it. Anyway, tmpwatch is by nature a cron-driven program, so putting something like this (shamelessly ripped from Red Hat) to /etc/cron.daily/tmpwatch or so would be cool:

---
/usr/sbin/tmpwatch 240 /tmp
/usr/sbin/tmpwatch 720 /var/tmp
for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do
    if [ -d "$d" ]; then
        /usr/sbin/tmpwatch -f 720 $d
    fi
done
---

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Aaron Walker (RETIRED) gentoo-dev 2004-09-18 09:43:16 UTC
As I see this package is fair game (owned by bug-wranglers), I'll be maintaining it (and taking its open bugs).
Comment 2 Aaron Walker (RETIRED) gentoo-dev 2004-09-18 12:52:09 UTC
Just bumped tmpwatch to 2.9.1-1, which includes a cron script (disabled by default) installed into /etc/cron.daily.  Includes examples for some common uses such as deleting old distfiles.  Thanks for the report.
Comment 3 Aaron Walker (RETIRED) gentoo-dev 2004-09-18 12:53:36 UTC
Forgot to mention, if for some reason you notice anything wrong with the cron script, please repoen this bug, instead of filing a new one.  Thanks again.
Comment 4 Janne Pikkarainen 2004-09-19 05:14:37 UTC
Looks good. Thank you and keep up the good work!
Comment 5 ra 2004-09-19 18:33:32 UTC
Noticed a typo:

#PORTAGE_TMPDIR="$(portageq envvar PORTAGE_TMP_DIR)/portage"

should be

#PORTAGE_TMPDIR="$(portageq envvar PORTAGE_TMPDIR)/portage"
Comment 6 Aaron Walker (RETIRED) gentoo-dev 2004-09-20 02:21:54 UTC
Fixed.  Thanks very much for pointing that out.
Comment 7 Lionel Bouton 2005-05-08 04:16:34 UTC
The cron script gives the following example:

# Delete everything in PORTAGE_TMPDIR that hasn't been modified in 2 weeks.
#
#if [[ -d ${PORTAGE_TMPDIR:-/var/tmp/portage} ]]; then
#  ${TMPWATCH} --mtime --all 336 ${PORTAGE_TMPDIR:-/var/tmp/portage}
#fi

It bited me when I activated this one because the mtime of the source files unpacked in /var/tmp/portage can be earlier than what tmpwatch expects.
An emerge running while this command is run can fail or leave the system in an unknown state.

--mtime should be changed in --atime and the user advised to check that /var/tmp/portage isn't on a filesystem mounted with 'noatime'.
Comment 8 Aaron Walker (RETIRED) gentoo-dev 2005-05-08 04:53:26 UTC
Please open a seperate bug.  A patch for this would be greatly appreciated.