There's also tmpwatch:
Code:
$ man tmpwatch
TMPWATCH(8) System Administrator's Manual TMPWATCH(8)
NAME
tmpwatch - removes files which haven't been accessed for a period of time
SYNOPSIS
tmpwatch [-u|-m|-c] [-MUXadfqstvx] [--verbose] [--force] [--all]
[--nodirs] [--nosymlinks] [--test] [--fuser] [--quiet]
[--atime|--mtime|--ctime] [--dirmtime] [--exclude path]
[--exclude-user user] [--exclude-pattern pattern]
time dirs
DESCRIPTION
tmpwatch recursively removes files which haven't been accessed for a given time. Nor-
mally, it's used to clean up directories which are used for temporary holding space
such as /tmp.
When changing directories, tmpwatch is very sensitive to possible race conditions and
will exit with an error if one is detected. It does not follow symbolic links in the
directories it's cleaning (even if a symbolic link is given as its argument), does not
switch filesystems (including non-trivial bind mounts), skips lost+found directories
owned by the root user, and only removes empty directories, regular files, and sym-
bolic links.
By default, tmpwatch dates files by their atime (access time), not their mtime (modi-
fication time). If files aren't being removed when ls -l implies they should be, use
ls -u to examine their atime to see if that explains the problem.
If the --atime, --ctime or --mtime options are used in combination, the decision about
deleting a file will be based on the maximum of these times. The --dirmtime option
implies ignoring atime of directories, even if the --atime option is used.
The time parameter defines the threshold for removing files. If the file has not been
accessed for time, the file is removed. The time argument is a number with an
optional single-character suffix specifying the units: m for minutes, h for hours, d
for days. If no suffix is specified, time is in hours.
Following this, one or more directories may be given for tmpwatch to clean up.
OPTIONS
...
You can schedule it safely with cron.
dd_wizard
---------- Post added at 10:53 AM ---------- Previous post was at 10:47 AM ----------
With an appropriate age parameter, you should be able to call it in your ~/.bash_logout, also.
dd_wizard