Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Linux: Count Mail Sent in Past Hour

Posted on 2013-11-15
3
Medium Priority
?
373 Views
Last Modified: 2013-11-15
From a Linux command line is there any way to find out how many email messages have been sent by the server within the past hour?
0
Comment
Question by:hankknight
  • 3
3 Comments
 
LVL 13

Expert Comment

by:duncanb7
ID: 39651367
find  /var/log/maillog  -mmin -60 |xargs grep -c "Message accepted for delivery" |wc -l

/var/log/maillog , mail log file may put into diff dir depend on your system



Note: for find with last hour
==============================
find srch_dir -cmin -60 # creation time

or


find srch_dir -mmin -60 # modification time
or


 find srch_dir -amin -60 # access time
0
 
LVL 13

Accepted Solution

by:
duncanb7 earned 2000 total points
ID: 39651486
find  /var/log/maillog  -mmin -60 |xargs grep -c "Message accepted for delivery" |wc -l

Could you try this  that I changed ?
0
 
LVL 13

Expert Comment

by:duncanb7
ID: 39651670
Thanks , hava a nice day and good weekend
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month20 days, 15 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question