- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- mailx / elm problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2005 05:22 AM
06-24-2005 05:22 AM
To clean it up...is there anyway I could do a batch delete of certain messages using mailx?
I would need to be able to delete using a certain word like "eship" in the body of the message. Any nice neat script for that?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2005 05:26 AM
06-24-2005 05:26 AM
Re: mailx / elm problem
That will bring you down to zero root messages. My systsems copy it off to archive, in case I need it and do this once a month/week depending on the system.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2005 07:29 AM
06-24-2005 07:29 AM
Solution# cat delmail
#!/bin/sh
# script to delete mail older then current month
# gwild
if [ $# -lt 1 -o \( $# -gt 1 -a $# -lt 4 \) ]
then
echo "Usage:"
echo "delmail \"userid\""
echo "Example:"
echo "delmail root"
exit 1
fi
MONTH=`date +%b`
USER=$1
E=`mailx -H -u $USER |grep -v $MONTH |wc -l`
echo "d1-$E" |mailx -u $USER
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2005 01:04 PM
06-24-2005 01:04 PM
Re: mailx / elm problem
Use the command 'mailq' to look at mails in the mail queue. You will get these infos about the mails and eventually some error messages:
-Q-ID- -Size- --Q-Time-- ---Sender/Recipient---
The Q-ID is a number of the form NAAnnnn, with N being a letter to ensure a unique name and nnnn being the process ID of the creating process.
The mail-queue itself is located in the directory /var/spool/mqueue. In this directory the messages can be refound with help of the Q-ID. Each message consists of two files:
qfNAAnnnn -- Job control file (header infos)
dfNAAnnnn -- Data file (message body)
Others are just created and deleted during delivery:
tfNAAnnnn -- Temporary file (image of qf during queue rebuild)
xfNAAnnnn -- Transcript file (contains a record of the job)
nfNAAnnnn -- Job creation file (exists while message ID is being created)
lfNAAnnnn -- Lock file (job synchronizer -exists if job is being processed)
If you want to delete a message you just have to get the Q-ID with the command mailq, then you can delete the belonging qf and df file in the directory /var/spool/mqueue.
regards
vinod K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2005 02:40 PM
06-24-2005 02:40 PM
Re: mailx / elm problem
50000 messgaes will take a lot of space in /var. If you dont want old mails. you can delete the /var/mail/root file. or Copy as /var/mail/root.org and then create a zero byte /var/mail/root file.
Cheers !!!
eknath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2005 03:21 PM
06-24-2005 03:21 PM
Re: mailx / elm problem
You can make a copy of the /var/mail/root if you want to go through each one of them and then do a more/view on that file to read them
Otherwise doing the
cat /dev/null > /var/mail/root is the best way to get rid.
thanks
Devesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2005 11:18 PM
06-26-2005 11:18 PM
Re: mailx / elm problem
Thanks