LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 09-11-2007, 10:05 AM   #1
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Rep: Reputation: 51
delete messages in /var/mail/root using a script


hi

howto delete messages older than 14 day in /var/mail/root using a script ?
I have debian etch

kind regards
cccc
 
Old 09-11-2007, 10:25 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
This simple command should do it:

Code:
find /var/mail/root -type f -mtime +14 | xargs -r rm -f
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to open mail spool file /var/mail/root cccc Debian 4 09-14-2006 01:31 PM
delete mail attathments while keeping my messages csanchisb Linux - Software 3 07-20-2005 01:41 PM
/var/spool/mail/root mail message absalon Linux - General 1 07-04-2005 09:08 PM
What is this ? Mail Python in /var/log/messages knowsnothing Mandriva 1 12-01-2004 11:04 AM
Trigger script by message in /var/log/messages? Zoidy Linux - Software 3 01-17-2004 12:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 11:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration