Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

From the man page for at/batch, it says

The user will be mailed standard error and standard output from his 
commands, if any. Mail will be sent using the command /usr/sbin/sendmail. 
If at is executed from a su(1) shell, the owner of the login shell will 
receive the mail.

But how do configure what email address its sent to?

In cron can use the MAILTO enviroment variable, but can't see that anywhere within at or batch.

share|improve this question

I don't see a way of doing that in the at invocation, but you could probably do something like this with the command you're calling via at:

 $ at 16:00
 at> some-command [arguments, &c.] 2>&1 | sendmail [-f <from-address>] <recipient>
 at> ^D

When the command runs, it will hand off its output to sendmail for delivery to the specified recipient, and in the quick test I've just run, this does work.

Of course, if you're already redirecting the output from some-command to go somewhere else, you might be out of luck -- but, then, you could always tee(1) the output, or add a final line to the at job calling sendmail to push out the message.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.