etcdaily


/etc/daily

The /etc/daily script is run once per day, from root's crontab, and performs very simple system checks and maintenance. The results of this check are mailed to root. The /etc/daily script performs the following actions:

  • Removes temporary files, such as old X11/SSH lockfiles, accounting records, and so on.

  • Checks disk status.

  • Generates network statistics.

The script will also perform some basic maintenance on certain other systems, if those systems appear to be active and configured. For example, if /etc/distfile exists, /etc/daily will run rdist(1). This script also runs the /etc/security script. The /etc/daily script also has additional functionality that can be turned on or off through the use of environment variables in root's crontab or in /etc/daily.local.

Root Filesystem Backups

One nice feature OpenBSD provides is the ability to back up the root file system each day. While you can lose most of your partitions and have some hope of recovering, losing the root file system will make it almost impossible to boot your system. You'll have to provide a partition to put this backup root file system on, the same size as your existing root file system and almost certainly on another disk. The backup root file system has the same location limitations as the standard root file system (see Chapter 3).

List your backup root file system in /etc/fstab, with a mount type of "xx", like this.

 /dev/sd3a /altroot ffs xx 0 0 

You won't be able to mount this file system as you could any other files ystem listed in /etc/fstab, as "xx" is not a valid mount type. The /etc/daily script will recognize this as an alternate root partition, however, and overwrite the entire contents of this partition with your root drive. To make this work, set ROOTBACKUP=1 in either /etc/daily.local or in root's crontab.

Daily Filesystem Integrity Check

You might want to perform a very simple fsck(8) on your hard drives to see if any obvious errors appear. While OpenBSD cannot perform an intrusive fsck(8) while the system is running, it can perform a basic integrity check to see if anything is obviously out of whack. To enable this, set CHECKFILESYSTEMS to 1 in root's crontab or in /etc/daily.local.




Absolute Openbsd(c) Unix for the Practical Paranoid
Absolute OpenBSD: Unix for the Practical Paranoid
ISBN: 1886411999
EAN: 2147483647
Year: 2005
Pages: 298

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net