crond
Execute periodically scheduled commands
TLDR
Start daemon in the background and check for scheduled commands
Start daemon in the foreground and check for scheduled commands
Send job output from the daemon to the [s]ystem log
Override default limitations and accept custom crontables
Inherit crontab file path from environment settings
SYNOPSIS
crond [-c dir] [-d [num]] [-f] [-h] [-l [num]] [-m {off|on|mailto}] [-n] [-p [pidfile]] [-s] [-t dir] [-x mask]
PARAMETERS
-c dir
crontab spool directory (default: /var/spool/cron)
-d [num]
debug level (0-16); implies -n -s
-f
foreground mode
-h
display help and exit
-l [num]
syslog log level (1-11)
-m {off|on|mailto}
mail mode: off, on, or mailto:user
-n
no daemonize; run in foreground
-p [pidfile]
PID file path (default: /var/run/crond.pid)
-s
slow startup; load all crontabs
-t dir
allow/deny directory (default: /etc/cron.d)
-x mask
enable debug flags (e.g., authpriv,cron)
DESCRIPTION
crond is the background daemon that implements cron scheduling on Linux and Unix-like systems. It reads configuration from crontab files and executes commands at specified times, typically running as root with a one-minute granularity.
Crontabs are user-specific files in /var/spool/cron/crontabs/ or system-wide in /etc/crontab and /etc/cron.d/. Each entry follows the format: minute hour day month weekday user command, using asterisks (*), lists, ranges, and step values for flexibility. For example, 0 2 * * * /usr/bin/backup runs a backup daily at 2 AM.
The daemon logs via syslog (e.g., /var/log/cron), sends job output as email (if configured), and supports environment variables like PATH (limited for security). It handles job queuing, locking to prevent overlaps, and reloads via SIGHUP.
Common uses include log rotation, updates, backups, and monitoring. Alternatives like systemd timers offer modern replacements, but crond remains standard for compatibility.
CAVEATS
Must run as root; insecure jobs risk privilege escalation. Limited PATH in jobs. No sub-minute scheduling. Check logs for failures.
KEY FILES
/etc/crontab: system crontab
/var/spool/cron/*: user crontabs
/etc/cron.d/: drop-in jobs
SIGNALS
SIGHUP: reload crontabs
SIGTERM/SIGQUIT: shutdown
SIGUSR1: rotate log
HISTORY
Originated in 1975 from Brian Kernighan's Bell Labs cron. Paul Vixie's 1987 ISC cron became dominant. Evolved into packages like cronie (2007, RHEL), dcron, fcron for features like PAM, ACLs.


