[WBEL-users] [OT] Deleting files by date
Andy Rabagliati
andyr@wizzy.com
Tue, 20 Jul 2004 15:41:16 +0200
On Tue, 20 Jul 2004, Jeff Maze wrote:
> Hello,
> I was wondering if it's possible to delete files by a certain date
> period (say over the last week). Our secondary mail server has over 4000
> messages that are over a week old, etc (even though sendmail is setup to
> delete messages after 2.5 days in queue). I'd like to delete these messages
> that should have been deleted (leave 2.5 days worth of messages in the
> /var/spool/mqueue directory).
> Thanks..
In the days of Usenet News there was only one place to ask questions and
get answers. The Balkanisation of this into a myriad of mailing lists is
a step backwards.
Your question is best asked on a general Unix mailing list, your local Linux
Users group, comp.os.linux.questions, or (better) a quick google.
This list is to address issues specific to whitebox vs RHEL, installs,
packages, configuration.
To answer your question, "find" is your friend.
find /path/to/sendmail/messages +ctime 7 | xargs rm
Will probably do the job.
To do it regularly, "man crontab" and "man 5 crontab".
Cheers, Andy!