On Jul 21, 2014, at 11:52 AM, Ken Stephens <[email protected]> wrote:

> Rich Shepard wrote:
>> On Sat, 19 Jul 2014, Rich Shepard wrote:
>> 
>>> Ever since last weekend's aborted attempts to modify log rotation
>>> intervals (which were completely rolled back), one of the scripts in
>>> cron.daily (0logwatch; a soft link to
>>> /usr/share/logwatch/scripts/logwatch.pl) stopped running. At least, I'm not
>>> getting the reports mailed to me each morning at 04:40.
>>    Now I'm completely flumfloxed: in root's crontab is this line:
>> 
>> 45 4 * * * /usr/share/logwatch/scripts/logwatch.pl 1> /dev/null
>> 
>> and logwatch.pl contains,
>> 
>> # if MAILTO is set in the environment, grab it, as it may be used by cron
>> # or anacron
>> if ($ENV{'MAILTO'}) {
>>     $Config{'mailto'} = $ENV{'MAILTO'};
>> } else {
>>     $Config{'mailto'} = "root";
>> }
>> 
>>    So what might be the reason it's not run with the results in my inbox as
>> they used to be every morning? If, as root, I manualy invoke logwatch.pl
>> from the command line and pipe the results to 'mailx -s "Logwatch"
>> rshepard@..." it soon shows up in the inbox.
>> 
>>    Your thoughts and suggestions?
>> 
>> Rich
>> 
> Rich,
> 
> Looks to me like you need to put a MAILTO environment variable in your 
> root's ".bashrc" file if you use the bash shell as root's default.
> 
> export MAILTO="rshepard"  or whatever your username is on your laptop.
> 
> Could it be that simple?

Alternatively, make sure the /etc/aliases file has your email address in it for 
root. The second part of that if/then/else will then work. 

Russell Johnson
[email protected]



_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to