The
mailnotify script prints messages while it works. To work with
crontab, this needs to be redirected to
/dev/null if somebody has a very frequent
mailnotify interval. Otherwise the sheer amount of mail will overwhelm. Presently, if the messages are redirected to
/dev/null, the error messages get thrown away too. So,
- The error message and informational message should be distinguished from each other. Error messages need to be sent to
STDERR so that general messages can safely be thrown away.
- Information messages should be displayed (or not) only when the user choose so under control of a command line switch.
Simple diffs as example
20a21,22
> my $debug = @ARGV && $ARGV[0] eq "-d";
>
25c27
< print "TWiki mail notification\n";
---
> $debug && print "TWiki mail notification\n";
39c41
< print "End Twiki mail notification\n";
---
> $debug && print "End Twiki mail notification\n";
50c52
< print "Checking TWiki.$webName\n";
---
> $debug && print "Checking TWiki.$webName\n";
53c55
< print "* Error: Web $webName does not exist\n";
---
> print STDERR "* Error: Web $webName does not exist\n";
59c61
< print "- Note: Notification list is empty\n";
---
> $debug && print "- Note: Notification list is empty\n";
92c94
< print "- Note: No topics changed since $time\n";
---
> $debug && print "- Note: No topics changed since $time\n";
96c98
< print "- Changed topics since $time: ";
---
> $debug && print "- Changed topics since $time: ";
121c123
< print "$bar[0] ";
---
> $debug && print "$bar[0] ";
131c133
< print "- Note: Topic list is empty\n";
---
> $debug && print "- Note: Topic list is empty\n";
134c136
< print "\n";
---
> $debug && print "\n";
152c154
< print "- Sending mail notification to: $notifylist\n";
---
> $debug && print "- Sending mail notification to: $notifylist\n";
155c157
< print "- ERROR: Can't send mail\n- End Twiki.$webName\n";
---
> print STDERR "- ERROR: Can't send mail\n- End Twiki.$webName\n";
157c159
< print "- End Twiki.$webName, mail notification sent\n";
---
> $debug && print "- End Twiki.$webName, mail notification sent\n";
--
ManpreetSingh - 20 Sep 2000
Made changes with exception: Use
-q switch for quiet mode instead of
-d switch for verbose mode. This is to show outbut by default, more userfriendly for first time user.
Commited changes to
TWikiAlphaRelease. See also
MonitoringSiteActivity.
--
PeterThoeny - 20 Sep 2000