– FreeBSD server housekeeping
Notes to myself about server housekeeping. New things may be introduced.
Updating system packages
pkg update
pkg upgrade
Apply security patches
freebsd-update fetch
freebsd-update install
Update system packages in all jails
# Get ID of each jail
JAILS=$(jls | awk 'NR!=1' | awk '{print $1}')
# Update package repo of each jail (3 in parallel)
echo $JAILS | xargs -P 3 -I _ pkg -j _ update
# Upgrade packages of each jail (sequentially)
echo $JAILS | xargs -I _ -o pkg -j _ upgrade
Applying security patches in all jails
# Get ID of each jail
JAILS=$(jls | awk 'NR!=1' | awk '{print $1}')
# Fetch patches
echo $JAILS | xargs -I _ -o jexec _ freebsd-update fetch
# Install patches (sequentially)
echo $JAILS | xargs -I _ -o jexec _ freebsd-update install