DAILY(8)
π DAILY(8) β from the System Manager's Manual, but make it group-chat π
πΈ NAME πΈ
daily, weekly, monthly β periodic system maintenance
β¨ DESCRIPTION β¨
okay so bestie, picture this: /etc/daily, /etc/weekly, and /etc/monthly are three shell scripts, and the clock daemon cron(8) runs them on a periodic basis. They take care of some basic administrative tasks, and their output β if there is any β is mailed to root.
β οΈ note, and this part matters: the scripts are all run as part of root'scrontab(5). But it is strongly suggested that root's 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/mailuntil the partition holding it runs out of space. Seenewaliases(8)for further details.
These scripts should not be altered β periodt. 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. it's giving βprep work before the main character walks inβ energy, honestly.
π /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. yes, the digital clutter cleanup slay. - 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. Seeaccton(8),lastcomm(1), andsa(8). - Creates a backup root file system which is updated daily. This only happens if the following conditions are met:
- The environment variable
ROOTBACKUPmust be set. For example, the following can be added to/etc/daily.local:
- The environment variable
ROOTBACKUP=1
- The mount directory
/altrootmust exist, and there must be an/etc/fstabentry specifying a configured disk device, the file system typeffs, andxxfor 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. lowkey a vibe check for your daemons. - Reports on which file systems need to be dumped via
dump(8). - Runs the
calendar(1)utility unless the environment variableCALENDARis set to0in/etc/daily.localor the host is ayp(8)client. - If
CHECKFILESYSTEMSis set to1in/etc/daily.local, runsfsck(8)with the no-write flag (-n). - If the file
/etc/Distfileexists, runs therdist(1)utility. - Runs the system
security(8)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)database, if there is an existing/var/db/locate.databasefile. - Rebuilds the
whatis(1)database(s) viamakewhatis(8). - If
LOGINACCOUNTINGis set to1in/etc/weekly.localand the/var/log/wtmpfile exists, show individual users' login via theac(8)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 to0, do not runcalendar(1).CHECKFILESYSTEMSβ If set to1, runfsck(8)with the no-write flag.ROOTBACKUPβ If set to1, make a backup of the root file system.
The following variables can be set in /etc/weekly.local:
LOGINACCOUNTINGβ If set to1, runac(8)to report login accounting.MAKEWHATISARGSβ Arguments formakewhatis(8); 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β Rootcrontab(5).
π SEE ALSO π
calendar(1), crontab(1), locate(1), rdist(1), whatis(1), crontab(5), ac(8), accton(8), cron(8), dump(8), fsck(8), makewhatis(8), sa(8), security(8), yp(8)
π 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) 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) for such services.
π sign-off: this page comes from Debian, dated July 4, 2024 β and that's the whole vibe, bestie. π
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2003 Jason McIntyre <jmc@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms