mcaffe-autoupdate.gnu

Mariano Absatz mailscanner at LISTS.COM.AR
Thu May 29 19:32:36 IST 2003


Hi,

I did a small patch to mcaffe-autoupdate.gnu so that, when invoked with "-v"
it tells me what it finds, even when it doesn't update anything... I also
added a "date" command so I see when things happen.

I usually redirect the cron output to a log instead of getting an e-mail,
like this:

0 * * * * /opt/MailScanner/lib/mcafee-autoupdate.gnu -v >> /log/av_update



So I'd rather be informed of every run and when it does it (I don't have the
e-mail's date: field here).

The script remains silent when nothing is done and the "-v" option is not
used.


*** mcafee-autoupdate.gnu       Thu May 29 15:11:18 2003
--- mcafee-autoupdate.gnu.new   Thu May 29 15:29:19 2003
***************
*** 28,33 ****
--- 28,40 ----
  PATH=$LIBDIR:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  export PATH

+ # keep cron quiet by default
+ case $1 in
+         -v)
+                 echo -n START:
+                 date +"   %Y:%m:%d-%H:%M:%S"
+                 echo $0 starting...
+ esac

  # version number pattern
  MATCH=[0-9][0-9][0-9][0-9]
***************
*** 37,42 ****
--- 44,53 ----
  SED="/^DATVersion=\($MATCH\).$/!d;s//\1/;q"
  VERSION=$(wget --passive-ftp -q -O- $FTPDIR/update.ini | sed -e "$SED")

+ # keep cron quiet by default
+ case $1 in
+         -v)     echo Got file version $VERSION
+ esac

  DATDIR=$LIBDIR/$VERSION
  FILE=dat-$VERSION.tar
***************
*** 64,69 ****
--- 75,82 ----
          # keep cron quiet by default
          case $1 in
          -v)     echo Already have "$VERSION"
+                 echo -n END:
+                 date +"     %Y:%m:%d-%H:%M:%S"
          esac
          exit
  fi
***************
*** 139,144 ****
--- 152,159 ----

  echo
  echo Completed OK
+ echo -n END:
+ date +"     %Y:%m:%d-%H:%M:%S"


  # done



--
Mariano Absatz
El Baby
----------------------------------------------------------
Sarcasm is just one more service we offer.



More information about the MailScanner mailing list