I'm new to openSuse 11.1, I have several crontab jobs running, one of which creates a dynamic list of 'at' jobs each day. Is there a way for the emails which the 'sh' shell sends to /var/usr/email/dave to be forwarded to other email addresses, my research has come up blank, mainly because I'm not sure what I'm looking for. Cheers if anyone can help.
Since looking into this, when printing from perl after script executed in /bin/sh shell, /bin/sh emails the printout to /var/usr/mail/dave, I would like to simple forward this email to other pop3 accounts, one of which is accessible by my phone. My apologies my original question wasn't clear enough
Set the MAILTO
environment variable in the crontab
file to the name of the user you'd like to receive the mail. Add it if it's not there.
From man 5 crontab
:
In addition to LOGNAME, HOME, and SHELL, cron(8) will look at MAILTO if it has any reason to send mail as a result of running commands in ``this'' crontab. If MAILTO is defined (and non-empty), mail is sent to the user so named. MAILTO may also be used to direct mail to multi‐ ple recipients by separating recipient users with a comma. If MAILTO is defined but empty (MAILTO=""), no mail will be sent. Otherwise mail is sent to the owner of the crontab.