Hello, I'm new here so sorry in advance if this is the wrong section I'm posting in :/
I have to set[]up a server rack running FreeBSD 10.0 for my company's production system. I have some questions about how to manage updates/security updates in FreeBSD. I'm a bit confused about the different managers available, more in deep I'd like to know in what the programs below differs:
freebsd-update
portsnap
portmaster
portaudit
I found a script on another forum that should care about all updates in a system (in a crontab). Is it correct and may be useful in a production server?
Thanks a lot in advance for the reply and nice to meet you all
I have to set[]up a server rack running FreeBSD 10.0 for my company's production system. I have some questions about how to manage updates/security updates in FreeBSD. I'm a bit confused about the different managers available, more in deep I'd like to know in what the programs below differs:
freebsd-update
portsnap
portmaster
portaudit
I found a script on another forum that should care about all updates in a system (in a crontab). Is it correct and may be useful in a production server?
Code:
#!/bin/sh
LOG_FILE="/var/log/freebsd-update.log"
MAIL_ADDR="your@ema.il"
rm ${LOG_FILE}
echo "Starting updates: `date`" | tee -a ${LOG_FILE}
echo "***"
echo "*** Checking for FreeBSD patches..."
/usr/sbin/freebsd-update cron | tee -a ${LOG_FILE}
/usr/sbin/freebsd-update install | tee -a ${LOG_FILE}
echo "***"
echo "*** Updating ports tree..."
/usr/sbin/portsnap cron update | tee -a ${LOG_FILE}
echo "***"
echo "*** Looking for ports to update..."
/usr/local/sbin/portmaster -adH --no-confirm --delete-build-only | tee -a ${LOG_FILE}
echo "***"
echo "*** Checking installed ports for known security problems..."
/usr/local/sbin/portaudit -Fva | tee -a ${LOG_FILE}
echo "Finished updates: `date`" | tee -a ${LOG_FILE}
# the mail is usually sent by the cronjob anyway... else uncomment this line:
# mail -s 'Server update' ${MAIL_ADDR} < ${LOG_FILE}
# do we have a new UPDATING? i might want to read it :-)
if ( test ! -e /usr/ports/UPDATING.md5 ) ; then
md5 -q /usr/ports/UPDATING > /usr/ports/UPDATING.md5
else
currentmd5=$(cat /usr/ports/UPDATING.md5)
newmd5=$(md5 -q /usr/ports/UPDATING)
if [ $currentmd5 != $newmd5 ] ; then
mail -s 'New UPDATING file!' ${MAIL_ADDR} < /usr/ports/UPDATING
fi
fi
Thanks a lot in advance for the reply and nice to meet you all