crontab help
Hi,
I want to configure crontab to run particular command and crontab should forward that email to an ip address because we have configured mail relay. |
Hi,
do you have a question? Do you need help with something? Evo2. |
Thnx for replying.
Yes, that was my question. how to forward email to mail relay server using crontab? |
Hi,
I'm still not sure what you are asking. Are you asking how to write a crontab entry? If so, there is plenty of documentation. For example to send an email every 10 minutes: Code:
*/10 * * * * /path/to/script/that/sends/an/email |
No dude, i know how to make an entry in crontab. my question is:--
we can send mail to perticular mail id through crontab using MAILTO variable , if jobs are completed. but i wanna forward that mail to mail relay server. i know the ip of mail relay. plz tell me how to configure it? because there is no documentation on this. |
Cron/Crontab was created to execute scheduled jobs, when it comes to mailing information, crontab relies on the presence of a mail facility. Mail forwarding is done by a mailing service and not crontab (cron/crontab is dumb in that regard).
Could you describe what your actual problem is? It looks like you've already chosen a certain path to look for a solution (change something in cron/crontab, which seems to be the wrong path). |
Quote:
Basically i created a centos mirror and i created a BASH script to update those packages on regular basis and scheduled it at 5am. i want to send a mail when it completes the job. we have configured mail relay on another host. and i want whatever mail is sent when packages are updated that should be forwarded to that mail relay(192.168.0.X). and from there it will automatically be transferred to user mail box. |
Quote:
Quote:
Cron just sends mail to (for example) some.user@some.location.com and after it gives this mail to the mailer its job is done. The mail service decides what needs to be done with this specific mail. Maybe this link will help: 23.3. Mail Transport Agents |
Quote:
If that is the case, in that case what should be the "MAILTO" in crontab? If i am wrong. plz correct me. |
Quote:
Quote:
Quote:
|
Quote:
|
Quote:
|
Quote:
could anyone tell me the configuration of sendmail? |
man sendmail
you may find it is not 'sendmail' but another mail transfer agent (MTA) consult the documentation for your Linux Distro ^^ assumes you tried it and it 'failed' |
Quote:
- You need to configure your local MTA to use a Smart relay host, - You need to configure the MTA on your relay host to accept connections from your local MTA. How this needs to be done depends on which MTA('s) you are using. If(!!) your local host uses sendmail then editing the DS entry (under # "Smart" relay host (may be null)) should suffice (you do need to restart the service). Only you know the real FQDN (or IP) needs to be used, this is just a dummy example (mail is send to a host called other.mail.host): DSother.mail.host Setting up the other side (the MTA on other.mail.host) is more complicated. You first of all need to figure out which MTA is used (sendmail, postfix, exim, .. , ..). After that you can configure it to accept mail from the outside. |
All times are GMT -5. The time now is 12:50 AM. |