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 suggestions,

GB

AFAIK this is not a Linux Security forum question but OK. /var/spool/mail contents are basically plain text files (mbox format) so egrepping for ^Date (as in `date +'%a, %d %b %Y'`) and ^Subject could help narrow things down. Shouldn't be too hard to script.

Thanks :stuck_out_tongue: ... now it works!