User:Flyser/Low maintenance Gentoo

This article aims to collect instructions and scripts to reduce the maintenance overhead of gentoo to a minimum.

Use Cron
This is an advice rather than actual instruction and should be a no-brainer, but I want to mention it nonetheless: Whenever you need to execute the same tasks periodically, use a cron daemon.

Depending on the type of the task and the system, you may choose a traditional cron daemon such as vixie-cron or dcron or you might prefer a cron implementation that tries to be slightly more intelligent such as anacron, which is often a good choice of non-server systems.

Use atd
atd is a daemon, which allows users to schedule commands to run at one specific time. For example: Runs cc -o foo foo.c at 11:45 on the 29th January.

Set up a system logger
Unless you skipped this part of the gentoo installation guide, you should already have one. If you do, pause for a moment and ponder if its configuration could be improved.

Install ntpd
The ntp daemon is a convenient way to keep the clock of an unix system in sync. While you could also run ntp manually once in a while, the daemon solution is preferable as it uses the adjtime syscall to avoid large time jumps. Here is how you do it:

then, optionally edit /etc/ntpd.conf and run

Note that the system time will not change immediately after starting the daemon. Be patient.

Automatic system updates
First create the following script and make sure it's executable:

then add it to your crontab, e.g. like so

Automatic installation of security fixes
glsa-check