Koozali.org: home of the SME Server

Cron notification setup question.....

Offline Mjohnson

  • *
  • 172
  • +0/-0
Cron notification setup question.....
« on: December 20, 2004, 03:47:39 PM »
I appologize in advance for this question...

How do I change the mail notification address for the various Cron jobs?  Currently it is set to the default value of "root".  I want to send the notifications to a remote address, "admin@mydomain.com"  The root mail account is a dead end on my server, however, I am interested in receiving the notifications.

Thanks in advance.

MJ
......

cydonia

Cron notification setup question.....
« Reply #1 on: December 20, 2004, 08:25:49 PM »
Click on the email link in server-manager, and change the administrative notices email to whatever you want.

I believe this should be what you're after.

Offline Mjohnson

  • *
  • 172
  • +0/-0
Cron notification setup question.....
« Reply #2 on: December 20, 2004, 08:30:31 PM »
No, that does not do the trick...  

What I was looking at in the crontab file (/etc/crontab) is the setting Mail=root.  I believe this requires a template change to alter.  I am just not sure how to go about that.
......

cydonia

Cron notification setup question.....
« Reply #3 on: December 20, 2004, 10:29:15 PM »
This is untested by me, but I would do something like:

Create a file called "crontab" at:

/etc/e-smith/templates-custom/etc

Create the directory "etc" if it doesn't already exist.

Now add the line:

MAILTO=whatever@domain.com


Then go back out to the console and type:

/sbin/e-smith/expand-template /etc/crontab


Now, check the actual file at /etc/crontab and see how it looks.  I'm hope this will overwrite the original "MAILTO" line and not just add another one.


Let me know how this goes.

Tristan

bobk

Cron notification setup question.....
« Reply #4 on: December 20, 2004, 10:51:23 PM »
Quote from: "cydonia"
This is untested by me, but I would do something like:

Create a file called "crontab" at:

/etc/e-smith/templates-custom/etc

Create the directory "etc" if it doesn't already exist.

Now add the line:

MAILTO=whatever@domain.com
...

Tristan


The above will not work.

What you need to do is copy
etc/e-smith/templates/etc/crontab/00setup
to
etc/e-smith/templates-custom/etc/crontab/00setup

then - edit the file 00setup in the templates-custom directory

then do - sbin/e-smith/expand-template /etc/crontab

I do not know if this will accomplish what you want but it is the correct way to change the setting for 'MAILTO' in the etc/crontab file.

cydonia

Cron notification setup question.....
« Reply #5 on: December 21, 2004, 12:32:56 AM »
ahh. thanks for showing us the proper way to do it bob:)

I completely forgot about fragments...:P  Time to go study the docs regarding templating:)

EDIT: its so clear to me now...:-)