# Mailx bulk operations

**URL:** <https://community.unix.com/t/mailx-bulk-operations/365729>\
**Category:** Shell Programming and Scripting\
**Created:** [March 23, 2017, 5:32am UTC](https://community.unix.com/t/mailx-bulk-operations/365729 "2017-03-23T05:32:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![moneric](https://community.unix.com/letter_avatar/moneric/32/6_22734026db12803ebb3e059622ac3534.png) [@moneric](https://community.unix.com/u/moneric)\
**Post date:** [March 23, 2017, 5:32am UTC](https://community.unix.com/t/mailx-bulk-operations/365729/1 "2017-03-23T05:32:18Z")

</div>

Greeting.

How to download messages in bulk in mailx? e.g. how to download all the message received on mar-23-2017 and save as a file or download individual mailx message that received on mar-23-2017 as individual file and as a loop?

We are on `HP-UX centstdb B.11.31 U ia64 3294693583 unlimited-user license`

We monitor our system using some customised scripts and run it as cron jobs. The cron job will send the job status message as root. We will then logon to our server and check those messages. Is there a way we can bulk download the messages?

What we have in mind, is to bulk download, and then set up a search script for error and then send a daily report to us instead of us have to logon to the server and check manually for any failed cron jobs.

Thanks for all the help.

---

<div class="post-metadata">

**Author:** ![drysdalk](https://community.unix.com/letter_avatar/drysdalk/32/6_22734026db12803ebb3e059622ac3534.png) [@drysdalk](https://community.unix.com/u/drysdalk)\
**Post date:** [March 23, 2017, 6:41am UTC](https://community.unix.com/t/mailx-bulk-operations/365729/2 "2017-03-23T06:41:14Z")

</div>

Hi,

I don't myself have any direct experience with HP-UX, but I know that the `mailx` implementation on Solaris allows you to save ranges of messages, albeit not by date. Does the HP-UX implementation allow you to do the same ? If it does, then the man page for `mailx` should show that the `save` or `copy` commands let you do that, and give you the syntax.

If you absolutely have to do the saving by date however, and not simply be able to save ranges of messages, then a better option here (well, perhaps better isn't the right word, but an option anyway) would be to directly monitor the user's local mailbox in your monitoring script, rather than going via an MUA like `mailx` . Or if there's another server you could do the processing on, you could SCP or otherwise copy the mailbox file off, parse it, then do whatever you had to do based on what you found.
