#!/bin/csh -f # # gather configuration files from news servers into AFS # # mhpower, 16 November 1994 # set path = (/bin /usr/ucb /usr/bin) set thishost = `hostname` set nightlydir = /afs/sipb/machine/${thishost}/configs/nightly setenv KRBTKFILE /tmp/tkt_root.$$ if (`/bin/athena/machtype` == "sun4os") then /usr/local/bin/krbtgp -keyfile /etc/athena/srvtab -s rcmd.${thishost} else if (`/bin/athena/machtype` == "decmips") then /afs/net/tools/@sys/krbtgp -keyfile /etc/athena/srvtab -s rcmd.${thishost} else echo "Unsupported machine type: `/bin/athena/machtype`" exit 1 endif /bin/athena/aklog -cell sipb.mit.edu /usr/athena/bin/kdestroy touch ${nightlydir}/afs_access_test if ($status) then set quotainfo = `/bin/athena/fs listquota ${nightlydir} | sed -n 2p` set aclinfo = `/bin/athena/fs listacl ${nightlydir} | grep rcmd.${thishost}` /usr/lib/sendmail -t << END_OF_MESSAGE From: root@${thishost}.mit.edu To: usenet@mit.edu Reply-To: usenet@mit.edu Subject: ${thishost} gather-configs failed The gather-configs cron job on ${thishost} could not access the archive directory ${nightlydir} this morning. % fs listquota ${nightlydir} | sed -n 2p ${quotainfo} % fs listacl ${nightlydir} | grep rcmd.${thishost} ${aclinfo} --cron(8) on ${thishost} END_OF_MESSAGE /bin/athena/unlog exit 1 endif rm -f ${nightlydir}/afs_access_test mv -f ${nightlydir}/${thishost}-configs.tar.gz{,.old} /usr/local/bin/gtar -c -f ${nightlydir}/${thishost}-configs.tar -T ${nightlydir}/files.${thishost} /usr/local/bin/gzip -f --best ${nightlydir}/${thishost}-configs.tar /bin/athena/unlog exit 0