/etc/weekly output

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

/etc/weekly output

Mischa Diehm-3
Hi,

having > 100 server systems running OpenBSD it is annoying getting all
those weekly cron mails on monday. I know I could filter them but I
was wondering what the benefit of "Rebuilding locate database:.." is?

Thanks,
Mischa

====

Index: weekly
===================================================================
RCS file: /cvs/src/etc/weekly,v
retrieving revision 1.19
diff -u -p -u -r1.19 weekly
--- weekly 2 Feb 2007 14:52:48 -0000 1.19
+++ weekly 16 Mar 2009 09:10:15 -0000
@@ -8,17 +8,13 @@ PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/
 export PATH
 
 if [ -f /etc/weekly.local ]; then
- echo ""
- echo "Running weekly.local:"
  . /etc/weekly.local
 fi
 
-echo ""
 if [ -f /var/db/locate.database ]; then
  TMP=`mktemp /var/db/locate.database.XXXXXXXXXX`
  if [ $? -eq 0 ]; then
  trap 'rm -f $TMP; exit 1' 0 1 15
- echo "Rebuilding locate database:"
  UPDATEDB="/usr/libexec/locate.updatedb"
  echo "${UPDATEDB} --fcodes=- --tmpdir=${TMPDIR:-/var/tmp}" | \
     nice -5 su -m nobody 2>/dev/null 1>$TMP
@@ -36,14 +32,10 @@ else
  echo "Not rebuilding locate database; no /var/db/locate.database"
 fi
 
-echo ""
-echo "Rebuilding whatis databases:"
 makewhatis
 
 # If LOGINACCOUNTING is set to 1 in the environment, report user
 # accounting information
 [ "X$LOGINACCOUNTING" = X1 ] && {
- echo ""
- echo "Doing login accounting:"
  ac -p | sort -nr -k 2
 }

Reply | Threaded
Open this post in threaded view
|

Re: /etc/weekly output

Andreas Kahari
These logs are mailed to root by the root's crontab. You may easily
comment out or delete the "mail -s ..." part by editing the crontab
("sudo crontab -e").  The logs are also stored in /var/log on each
machine.  Changing the script is not a good solution because once the
scripts fail half-way though, you won't be able to debug as easily (or
even notice).

I personally wouldn't filter these messages out (as in deleting them
automatically), even for a large installation. They compress nicely
since they are so repetitive.

Regards,
Andreas

2009/3/16 Mischa Diehm <[hidden email]>:

> Hi,
>
> having > 100 server systems running OpenBSD it is annoying getting all
> those weekly cron mails on monday. I know I could filter them but I
> was wondering what the benefit of "Rebuilding locate database:.." is?
>
> Thanks,
> Mischa
>
> ====
>
> Index: weekly
> ===================================================================
> RCS file: /cvs/src/etc/weekly,v
> retrieving revision 1.19
> diff -u -p -u -r1.19 weekly
> --- weekly      2 Feb 2007 14:52:48 -0000       1.19
> +++ weekly      16 Mar 2009 09:10:15 -0000
> @@ -8,17 +8,13 @@ PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/
>  export PATH
>
>  if [ -f /etc/weekly.local ]; then
> -       echo ""
> -       echo "Running weekly.local:"
>        . /etc/weekly.local
>  fi
>
> -echo ""
>  if [ -f /var/db/locate.database ]; then
>        TMP=`mktemp /var/db/locate.database.XXXXXXXXXX`
>        if [ $? -eq 0 ]; then
>                trap 'rm -f $TMP; exit 1' 0 1 15
> -               echo "Rebuilding locate database:"
>                UPDATEDB="/usr/libexec/locate.updatedb"
>                echo "${UPDATEDB} --fcodes=- --tmpdir=${TMPDIR:-/var/tmp}" |
\

>                    nice -5 su -m nobody 2>/dev/null 1>$TMP
> @@ -36,14 +32,10 @@ else
>        echo "Not rebuilding locate database; no /var/db/locate.database"
>  fi
>
> -echo ""
> -echo "Rebuilding whatis databases:"
>  makewhatis
>
>  # If LOGINACCOUNTING is set to 1 in the environment, report user
>  # accounting information
>  [ "X$LOGINACCOUNTING" = X1 ] && {
> -       echo ""
> -       echo "Doing login accounting:"
>        ac -p | sort -nr -k 2
>  }
>
>



--
Andreas Kahari
Somewhere in the general Cambridge area, UK

Reply | Threaded
Open this post in threaded view
|

Re: /etc/weekly output

Stuart Henderson
In reply to this post by Mischa Diehm-3
On 2009/03/16 10:19, Mischa Diehm wrote:
>
> having > 100 server systems running OpenBSD it is annoying getting all
> those weekly cron mails on monday. I know I could filter them but I
> was wondering what the benefit of "Rebuilding locate database:.." is?

sometimes locate.updatedb fails with errors or makewhatis comes up
with warnings, and it's useful to see where the error message came from.

security(8) has some sections (like the rhosts file syntax check) where
the headers are only printed if there's some output from that section.
I think that method would be appropriate here.

Reply | Threaded
Open this post in threaded view
|

Re: /etc/weekly output

Marc Balmer-2
Am 16.03.2009 um 12:41 schrieb Stuart Henderson:

> On 2009/03/16 10:19, Mischa Diehm wrote:
>>
>> having > 100 server systems running OpenBSD it is annoying getting  
>> all
>> those weekly cron mails on monday. I know I could filter them but I
>> was wondering what the benefit of "Rebuilding locate database:.." is?
>
> sometimes locate.updatedb fails with errors or makewhatis comes up
> with warnings, and it's useful to see where the error message came  
> from.

Yes, it is useful if you get an error message.  But not the empty mails
every week? ;)

>
> security(8) has some sections (like the rhosts file syntax check)  
> where
> the headers are only printed if there's some output from that section.
> I think that method would be appropriate here.

Indeed, that would be useful.  Maybe Mischa can think of a way how
to achieve this.