Quote:
Originally Posted by yusufs
Thanks colucix, but for the same .. is it necessary to have sendmail configured in that machine..
|
If I'm not wrong, cron uses sendmail by default. Maybe someone can help to clarify this point.
Quote:
If so , is there anyway we can change the subject of the mail as per user requirements or wish
|
No. The crontab does not permit such a refinement. However if the user needs some output to be e-mailed, he/she can always use sendmail (or any other mailer) inside the script. E.g. something like
Code:
/usr/sbin/sendmail "m.rossi@domain.it" << EOF
From: colucix <colucix@null.domain>
To: Mario Rossi <m.rossi@domain.it>
Subject: my personalized subject $VARIABLE
`date "+%A %e %b %Y %T"` - my message here
`cat log_to_display_in_mail_body.log`
EOF
in this way you can send (in the subject or in the body of the e-mail) the content of any variable or any log generated by the script itself or the output of any command. Just an idea.