summaryrefslogtreecommitdiff
path: root/app-admin/tmpwatch/files/tmpwatch.cron
blob: d35a590379d7e5c88c48fa9bf4cf110cda375f3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/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.

### 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. 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
# fi

# Delete everything in PORTAGE_TMPDIR that hasn't been modified in 2 weeks.
#
# 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).
#
# 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.
#
# if { PORTAGE_LOGDIR=$(portageq envvar PORTAGE_LOGDIR) ||
# 	PORTAGE_LOGDIR=$(portageq envvar PORT_LOGDIR); } &&
# 	[ -d "${PORTAGE_LOGDIR}" ]
# then
# 	tmpwatch --atime 772 "${PORTAGE_LOGDIR}"
# fi