From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079040315887.tru64-unix-managers.marc@archive.invalid> From: Davis Date: Thu, 22 Apr 1999 23:14:11 +0000 To: tru64-unix-managers Subject: DSNLink Article check and new patch check X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079040315887 I've written two small utilities that make checking for new patches on the ftp.service.digital.com patch server and new DSNlink articles easy. They may be run from cron and mail their output. If you don't have dsnlink, the first one will use ftp to get the patch directory listing. For this to work, you must have a $HOME/.netrc file. Here's an example, see the ftp and netrc man pages for more info. # ls .netrc -rw------- 1 camel users 115 Apr 22 18:05 .netrc # more .netrc machine ftp.service.digital.com login anonymous password camel@bigbusiness.com Alan Davis Tru64 Unix Consultant ----- cut here #!/bin/ksh # run from cron # 10 5 1 * * /usr/users/me/bin/getnewpatch MAILTO=sysadmin PATCHDIR=public/dunix/v4.0e # if dsn is available, use it [ -x /usr/ucb/dsnlynx ] && { /usr/ucb/dsnlynx -dump ftp://ftp.service.digital.com/$PATCHDIR | \ /usr/bin/mailx -s "Patches for v4.0e" $MAILTO exit } # otherwise, use ftp [ -r $HOME/.netrc ] && { /usr/bin/grep -iqs "ftp.service.digital.com" $HOME/.netrc [ $? ] && { /usr/bin/ftp ftp.service.digital.com >/dev/null < /tmp/getnewpatch.$$" bye EOF /usr/bin/mailx -s 'Patches for v4.0e' $MAILTO < /tmp/getnewpatch.$$ /usr/bin/rm -f /tmp/getnewpatch.$$ } } ------ cut here #!/bin/ksh # run from cron # 0 5 1 * * /usr/users/me/bin/getnewdsn MAILTO=sysadmin DSNDIR=/usr/users/admin/dsn # put the date of last run in file here DSNDB=osf # which dsn database to use LAST=`cat ${DSNDIR}/lastgetnew.dat` DATE=`/usr/bin/date "+%m/%d/%Y"` D=`/usr/bin/date "+%m.%d.%Y"` cd $DSNDIR /usr/bin/cat /dev/null > /tmp/dsn_new.$$ /usr/ucb/dsnits >/dev/null 2>&1 < $DSNDIR/lastgetnew.dat exit -------- cut here ----- Alan C. Davis Employed by, but not Technology Services speaking for: davis@tessco.com Tessco, Inc. http://www.tessco.com