Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I schedule a job/command with at to be executed in the future, the standard output and error of the command is "mailed" to the user that did the scheduling.

So after my job runs, I get a message in the command prompt

You have mail in /var/spool/mail/mattb

which I can then read with mail.

Is it possible to have the output instead sent to my corporate mailbox (i.e. mattb@company.com), rather than the local user's /var/spool/mail?

How does at know which address to email the output of the command, or does it only know how to place a message in the user's /var/spool/mail?

(I would tag this question at but I don't have enough rep on this SE site for that yet)

share|improve this question

1 Answer 1

up vote 2 down vote accepted

at will typically use your installed mail transport agent (MTA) to deliver the mail. If you do not use local mail on the box at all, you can configure your MTA to forward all mail to another server.

Alternatively you can use a .forward file for a single user. If you put "mattb@company.com" in ~mattb/.forward then your MTA should forward your email there.

share|improve this answer
    
Thanks, this works perfectly! –  matt b Nov 5 '10 at 2:07

Your Answer

 
discard

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.