On Tue, 29 Mar 2005 14:14:16 -0800 (PST), David Rees wrote > On Tue, March 29, 2005 9:48 am, Pettit, Paul said: > > > > I don't want to go to each and every machine (I have more than 1) and > > manually run yum to update them. It defeats the purpose of having cron. > > In fact Fedora Legacy's own documentation has a specific step for adding > > automatic updates (step 4 - 7.3 documentation). There is no mention that > > this process is NOT recommended by FL nor would I expect one. To limit > > people to manually acting on updates devalues FL's service below > > Microsoft. > > I use a modified /etc/cron.daily/yum.cron to email me when a machine > has updates to apply. I'll paste it in below. > > To handle an automatic update for all machines, you could write a script > which goes out and runs yum update on all machines using ssh and public > key authentication so no manual intervention is required except to > initiate the command. For example for the automatic update script: > > #!/bin/sh > MACHLIST="mach1 mach2 mach3" > for i in $MACHLIST; do > ssh root@$i yum -y update > done > > You may want to use sudo instead of logging in directly as root. > > For the daily script which tells me daily which machines need updating: > > #!/bin/sh > > if [ -f /var/lock/subsys/yum ]; then > YUM="/usr/bin/yum" > DEBUG="-e 0 -d 0" > EMAIL="drees@xxxxxxxxxxxxxxxx" > LOG=`mktemp -q /tmp/yum.XXXXXX` > if [ $? -ne 0 ]; then > echo "$0: Can't create temp file for yum update, exiting..." > exit 1 > fi > $YUM -R 120 $DEBUG list updates | grep -v \ > "No Packages Available to List" >> ${LOG} > # Uncomment the next line to automatically update packages > #$YUM -R 120 $DEBUG -y update >> ${LOG} > if [ -s ${LOG} ] ; then > cat ${LOG} | mail -s "Yum Update Alert `hostname`" ${EMAIL} > else > # No packages to update, clean the cache > $YUM $DEBUG clean all > fi > > rm -f ${LOG} > fi > > Hope this helps. Feel free to use these scripts as needed or post > them on the FAQ as necessary! To each his own, however, I do not use the cron.daily version, but use a crontab entry: # run yum check for updates daily and mail results to root 0 5 * * * root /usr/bin/yum check-update 2>&1 | mail -s "yum check-update output" root -- fedora-legacy-list@xxxxxxxxxx http://www.redhat.com/mailman/listinfo/fedora-legacy-list