How to empty mail root


 
Thread Tools Search this Thread
Operating Systems Solaris How to empty mail root
# 1  
Old 11-06-2008
How to empty mail root

Hello i need to reduces the size of the mail of root (var/mail/root),
I have mail from last year.

how can i do it?

thank you for your time.
# 2  
Old 11-06-2008
This will delete all mail for user root:

Code:
cat /dev/null > /var/mail/root

# 3  
Old 11-06-2008
yes , thank you for the answer but i donīt wanīt to remove all the mail i wanīt to leave last ten o 20..can be done?? thank you very much
# 4  
Old 11-06-2008
I think you can specify a range to delete.
Like if you have 14020 mails, you could delete 14000:

Code:
mailx -N
> d  1-14000
> q

Or something like that. Do a search on the forum, there a few other threads on this already.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Run sql script and send to mail if not empty?

Thanks again for helping me out. I was wondering if anyone else has encountered this issue. I have a SQL script that produces a list -however we are only interested in that list if the length is not zero Here is the sql file named dailyBalance.sql select * from Balance where... (1 Reply)
Discussion started by: Astrocloud
1 Replies

2. UNIX for Advanced & Expert Users

[SOLVED] Root mail going to user "mail" instead of root

I running Linux Mint Debian Edition tracking testing and have started a cron job that will send something to the root mailbox. Mint has heirloom and exim4 installed. However, mail was getting nothing. I realized that in /etc/aliases, there was a line root: mintSince you can't log into the mint... (0 Replies)
Discussion started by: Narnie
0 Replies

3. Solaris

root mail file corrupted

Hi, We were facing cron job failures and raised a case to our UNIX team, they fixed the issue and said cron job failures due to root mail file corruption. My questions are, 1. Whether root mail file corruption cause cron job failures? 2. Do we have any size limitation for root mail file?... (0 Replies)
Discussion started by: paventhan
0 Replies

4. UNIX for Dummies Questions & Answers

MTA problems; root gets no mail

Hello, I am afraid that I goofed up my mailing system. I have an Ubuntu 9.10 system $ uname -smor Linux 2.6.31-14-generic x86_64 GNU/Linux I am wanting to receive cron job mails. I noticed that cron jobs were trying to send mail to sendmail. I had installed ssmtp so I could send mail... (1 Reply)
Discussion started by: Narnie
1 Replies

5. UNIX for Dummies Questions & Answers

What should I do with root mail?

Maybe a stupid question, but I'd like to know others opinions. I have more than 250 servers (mostly domU) and now I'm redirecting root mail to a local account on every vps. To tell U the truth I never read them, but I don't know if I'm making a mistake. My question is simple, what should you do... (1 Reply)
Discussion started by: iga3725
1 Replies

6. Cybersecurity

Last 24 hours of /var/mail/root/

Hi there, I'm using this command line to get a daily mail through crontab with the content of /var/mail/root: mailx -s "Test My Server" mymail@mail.com </var/mail/root and it works fine, but I'd like to get only the information updated in the last 24 hours. Thanks in advance for any... (2 Replies)
Discussion started by: Giordano Bruno
2 Replies

7. SuSE

no mail for root

I want to send an email for SLES server. But when I try with "mail" command it gives me "no mail for root" error. I checked /var/mail/ directory and nothing in there. Any ideas. Thanks (1 Reply)
Discussion started by: s_linux
1 Replies

8. HP-UX

HP UX root mail

When I want to see mail after login as root. The screen goes crazy showing lots lots lots of Email. Is there anyway I can delete some old Email?? How? Thanks (1 Reply)
Discussion started by: ldaliosmane
1 Replies

9. AIX

Cannot send mail to root@localhost but can externally

hello, I need to configure our AIX 5.3 to relay mail to exchange. I have got this working with no issues yet, I can not send mail to root@localhost. # uname -a AIX Blade1 3 5 0000E6DAD400 # oslevel -s 5300-07-01-0748 # mailq /var/spool/mqueue (2 requests)... (14 Replies)
Discussion started by: pobman
14 Replies

10. Solaris

forward root mail

how can i forward roots mail, i want every mail fowarded (1 Reply)
Discussion started by: csaunders
1 Replies
Login or Register to Ask a Question