Helpful Information
Home
Categories
Contact us
Category: Linux Help
re-specify cron response email address
after the cron jobs were done , it will mail out a email to the root or the equivalent.
Can and how we re-specify the email address e.g. xyz@hotmail.com?
thanks!
Just specify xyz@hotmail.com at the end of your cron line followed by mail or sendmail command.
For example:
15 3 * * * /bin/sh /etc/daily 2>&1 | tee -a /var/log/daily_log | mail -s "Daily output at `date`" xyz@hotmail.com
You are right. I knew this now, if I do not specify, it will send to my normal email account.
I want to ask machine to send me a 'the content of dmesg' which is store in 'iamfine' at 05:39 called by 'iamworking'.
the script for 'iamworking' was written already.
cron:
38 5 * * * /home/jennifer/bscript/iamworking
39 5 * * * mail -s "Backup Linux Server All systems goes" xyzc@hotmail.com < /home/jennifer/bscript/iamfine
when I receive the email, it is not the real time dmesg. would u please help to correct this? thanks
I do not understand '2>&1 ' of your explanation!
>> it is not the real time dmesg
What real time? For whatever problem, it's within your script, therefore you need to fix it yourself.
>> I do not understand '2>&1 ' of your explanation!
You already asked me several times so I am not going to repeat my answer.
privacy (GDPR)