System Administration Practice

From Funtoo Linux
Revision as of 12:48, 29 November 2010 by Slashbeast (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Kept updated portage tree

Even if you do not doing full update everyday, you should upgrading portage tree. It will reduce time what you may need to sync tree before system upgrade. Also, if you just want install something, it will be installed with latest deps so you will not waste time on upgrading it while full system upgrade. Example script to upgrade portage and overlay every day

Code: /etc/cron.daily/autosync.sh
#!/bin/bash

log="/var/log/autosync.log"

if [ ! -f $log ]; then
	touch $log
	chmod 600 $log
	chown root:root $log
fi

echo >> $log
echo "*** autosync started! ($(date +'%d-%m-%Y %H:%M:%S'))" >> $log
echo "*** running emerge --sync" >> $log
emerge -q --sync >> $log 2>&1
if [ -f /usr/bin/layman ]; then
	echo >> $log
	echo "*** running layman -S" >> $log
	/usr/bin/layman -S --nocolor >> $log 2>&1
fi

Purge unused distfiles

Distfiles may took a lot of space, if you do not clean them from time to time it may be an issue. There is many way to cleanup them.

  • Remove distfiles which wasn't accessed in last 90 days. (WARNING: It will not work if distfiles are on filesystem with noatime option. You may want think about relatime).
Code: /etc/cron.daily/distfiles-auto-purge.sh
#!/bin/bash
find /usr/portage/distfiles -maxdepth 1 -type f -atime +90 -exec rm {} \;
Personal tools
Namespaces

Variants
Actions
Categories
Toolbox
Stuff