---
name: "daily"
section: "8"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["openbsd"]
url: "https://new.carta.tech/daily"
---

# daily(8)

periodic system maintenance

## NAME

**daily**, **weekly**, **monthly** – periodic system maintenance

## DESCRIPTION

The three files */etc/daily*, */etc/weekly*, and */etc/monthly* are shell scripts run on a periodic basis by the clock daemon, [cron(8)](/cron/8.md). They take care of some basic administrative tasks. Their output, if any, is mailed to root.

**Note**: The scripts are all run as part of root's [crontab(5)](/crontab/5.md). However, it is strongly suggested that the root mail account be an alias that forwards messages to a real user or set of users. Otherwise, root's mail will simply accumulate in */var/mail* until the partition holding it runs out of space. See [newaliases(8)](/newaliases/8.md) for further details.

These scripts should not be altered. Local additions should be made to the files */etc/daily.local*, */etc/weekly.local*, and */etc/monthly.local*, which will be executed by */etc/daily*, */etc/weekly*, and */etc/monthly*, respectively. The *\*.local* files are executed first, which makes it convenient to do any necessary cleanup and backup and to define any required shell variables before the script is run.

### /etc/daily

This script is run daily. It currently does the following:

- Runs the script */etc/daily.local*, if it exists.

- Removes scratch and junk files from */tmp*.

- Purges accounting records from */var/account*, if they exist. Processes that were killed due to pledge or memory access violations, or had file access prevented by unveil, are reported in the daily mail. See [accton(8)](/accton/8.md), [lastcomm(1)](/lastcomm/1.md), and [sa(8)](/sa/8.md).

- Creates a backup root file system which is updated daily. This only happens if the following conditions are met:

  1. The environment variable ROOTBACKUP must be set. For example, the following can be added to */etc/daily.local*:

     ```
     ROOTBACKUP=1
     ```

  2. The mount directory */altroot* must exist, and there must be an */etc/fstab* entry specifying a configured disk device, the file system type ‘ffs’, and ‘xx’ for the mount options, e.g.

     ```
     /dev/wd0j /altroot ffs xx 0 0
     ```

- Checks daemon status. Lists any daemons which are enabled in rc.conf.local(8) but which are not actually running.

- Reports on which file systems need to be dumped via [dump(8)](/dump/8.md).

- Runs the [calendar(1)](/calendar/1.md) utility unless the environment variable CALENDAR is set to 0 in */etc/daily.local* or the host is a [yp(8)](/yp/8.md) client.

- If CHECKFILESYSTEMS is set to 1 in */etc/daily.local*, runs [fsck(8)](/fsck/8.md) with the no-write flag (**-n**).

- If the file */etc/Distfile* exists, runs the [rdist(1)](/rdist/1.md) utility.

- Runs the system [security(8)](/security/8.md) check script.

### /etc/weekly

This script is run weekly. It currently does the following:

- Runs the script */etc/weekly.local*, if it exists.

- Rebuilds the [locate(1)](/locate/1.md) database, if there is an existing */var/db/locate.database* file.

- Rebuilds the [whatis(1)](/whatis/1.md) database(s) via [makewhatis(8)](/makewhatis/8.md).

- If LOGINACCOUNTING is set to 1 in */etc/weekly.local* and the */var/log/wtmp* file exists, show individual users' login via the [ac(8)](/ac/8.md) utility.

### /etc/monthly

This script is run monthly. It currently does the following:

- Runs the script */etc/monthly.local*, if it exists.

## ENVIRONMENT

The following variables can be set in */etc/daily.local*:

- CALENDAR

  If set to 0, do not run [calendar(1)](/calendar/1.md).

- CHECKFILESYSTEMS

  If set to 1, run [fsck(8)](/fsck/8.md) with the no-write flag.

- ROOTBACKUP

  If set to 1, make a backup of the root file system.

The following variables can be set in */etc/weekly.local*:

- LOGINACCOUNTING

  If set to 1, run [ac(8)](/ac/8.md) to report login accounting.

- MAKEWHATISARGS

  Arguments for [makewhatis(8)](/makewhatis/8.md); empty by default.

## FILES

- */etc/daily*

  Daily maintenance script.

- */etc/daily.local*

  Site specific daily maintenance script.

- */etc/weekly*

  Weekly maintenance script.

- */etc/weekly.local*

  Site specific weekly maintenance script.

- */etc/monthly*

  Monthly maintenance script.

- */etc/monthly.local*

  Site specific monthly maintenance script.

- */var/cron/tabs/root*

  Root [crontab(5)](/crontab/5.md).

## SEE ALSO

[calendar(1)](/calendar/1.md), [crontab(1)](/crontab/1.md), [locate(1)](/locate/1.md), [rdist(1)](/rdist/1.md), [whatis(1)](/whatis/1.md), [crontab(5)](/crontab/5.md), [ac(8)](/ac/8.md), [accton(8)](/accton/8.md), [cron(8)](/cron/8.md), [dump(8)](/dump/8.md), [fsck(8)](/fsck/8.md), [makewhatis(8)](/makewhatis/8.md), [sa(8)](/sa/8.md), [security(8)](/security/8.md), [yp(8)](/yp/8.md)

## HISTORY

The **daily**, **weekly**, and **monthly** scripts first appeared in 4.3BSD-Reno. This manual page first appeared in OpenBSD 3.4.

## CAVEATS

If the host machine is not running 24/7, these scripts may never be run. Adjusting the time fields in the system [crontab(5)](/crontab/5.md) may partially alleviate this problem.

Be careful when adding local additions. Services such as "www" have their own users, and should be run as such, not as root. It may be more appropriate to create a separate [crontab(5)](/crontab/5.md) for such services.
