Re: tmpwatch assistance
- From: Michael Heiming <michael+USENET@xxxxxxxxxxxxxx>
- Date: Wed, 9 Aug 2006 19:23:48 +0200
In comp.os.linux.misc DarinZ <darin.zimmerman@xxxxxxxxxx>:
I am a complete Linux novice, so I would appreciate any assistance with
my question. I have a RedHat server, and I am dumping files into the
following directory from another RedHat server:
I need to modify the existing tmpwatch, or create a new tmpwatch file
to clean out any files that are older than seven days old.
Can someone please tell me exactly what steps I would need to perform to
accomplish this ?
I'll tell you what I'd do.
We need to know what comes with the package first:
$ rpm -ql tmpwatch
Clearly arranged package you have to admit.
So it runs from cron.daily, lets look at the script:
$ cat /etc/cron.daily/tmpwatch
/usr/sbin/tmpwatch 240 /tmp
/usr/sbin/tmpwatch 720 /var/tmp
# [ more but not related here ]
Now what do those numbers mean?
Luckily there is a man page coming with it, right at the top we
find all switches/options:
tmpwatch [-u|-m|-c] [-faqstv] [--verbose] [--force] [--all]
[--test] [--fuser ] [--atime|--mtime|--ctime] [--quiet] <hours>
So the "240" and "720" are obviously hours. But we read on...
"tmpwatch recursively removes files which haven't been
accessed for a given number of hours. Normally, it's used to
clean up directories which are used for temporary holding space
such as /tmp. [..]"
There's a little more I left for you to read up. Now that wasn't
rocket science? Anything needed was already on your box, it is a
common mistake people STFW for hours with no luck. While all
information needed is already install and available at your
My suggestion if you are serious about Linux, run it on your
desktops/laptops, nothing will teach you as much as simply
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo zvpunry@xxxxxxxxxx | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 323: Your processor has processed too many
instructions. Turn it off immediately, do not type any
- tmpwatch assistance
- From: DarinZ
- tmpwatch assistance
- Prev by Date: Re: Network application design
- Next by Date: Website Utilization Software?
- Previous by thread: Re: tmpwatch assistance
- Next by thread: Network application design