From nobody Fri May 10 04:36:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VbGKk6hYNz5KnQW; Fri, 10 May 2024 04:36:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VbGKk5nSwz4gvV; Fri, 10 May 2024 04:36:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715315770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bM5U5k/AvOvAyfQyx+rgo7TsJKu4nQI2mzI8SA/kQwE=; b=k8Rhr6SR8YXs4WrR0Pm1XbolOZvDxhoGkpoT7gt3jxRBXAeMjPh1lwT4QxgZ6W733dU6wv ys8ZwhQgGj/Pdxa/V9zAdTa9W9OS13GWxVM5Vpm5yvXzn5E+Fczl7xxL8Kv6WWu5wtegl4 CWfzeNlZN/escBMF1bNxLaq+6bklMcM29qSIXWBA71XKrYYGr4BqL/LaYM5hOH45ouYHpt 6YZWYHGzIsHCAKl98/9bog7mUYkWtmLK2RPBTDiBeZMYA9fKHi9LC+jutrvfAiRHFrTplp qDPhjLexV6i2LotrIoJLzC66a7lZv+G319K6R3SMot+tH22PLAGrlqMua0D5uw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715315770; a=rsa-sha256; cv=none; b=EOZHq5SwwbOePIPJYvWTc+x4igrqS0ynu6BnE7Ry7/NZUzvrogH1JPx2eMmHLnF8/XgYbP SI+qH6WCJN/dB5/bUfwT0b2TeiljRciqcWH7rWhRYIYD1hmrCjYXZmEGVdyw4uA9A0lShY dBPZUucpClSkIqk2nM8x+VJJc5FC0q/CiDZBrO2eEw68PNwOSztaLgPpVWdDCs6WfInx5J VlcwGlec5T3QNXqw8VaiMZntTMb+V2CwgZAqqMoa7VHYGjj/+GL7difhgK/End7hyvpMWG wDXlRyASsMODlWg8D1s+kdhviB8H+QgZETGdHmkfB8P8h/2qqfxZbf9tvtNaaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715315770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bM5U5k/AvOvAyfQyx+rgo7TsJKu4nQI2mzI8SA/kQwE=; b=I+MrWWendbIUXTPigRFu5bVl5qzVzN7UTS//G17YbQ+C3FOkLicPLFjsJKK644UmUa0hy9 8CA6nED2hH12DG8l0SUgA47ggZTrLpHSK7kk0SD6KASZBNWHUyuyj1TDoztBDx1vUTO3FH Lz0TE6VSYrj0msJdKTgnyNwzojDm1gP2RcYLuIcOX7eu1UrhO/lybe1PUwiba1ofw2rFWQ N/0HDdA26UrGAfvndj+pnximWyDvlKJbb5vkZUfJZbXnbl7Psw8dsSNmfgadNmtMLIiEak s6D5jBtWTjSkF8xH5nVIz8B8dpekftJUj41l31CQOBuwO/vGTesAiKTG4vx6Fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VbGKk5P04zN2X; Fri, 10 May 2024 04:36:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44A4aA50089773; Fri, 10 May 2024 04:36:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44A4aAMK089770; Fri, 10 May 2024 04:36:10 GMT (envelope-from git) Date: Fri, 10 May 2024 04:36:10 GMT Message-Id: <202405100436.44A4aAMK089770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 042267e0cdda - main - Explain cron.d List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 042267e0cdda5cd90803b00a3d6a7dd1f403938d Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=042267e0cdda5cd90803b00a3d6a7dd1f403938d commit 042267e0cdda5cd90803b00a3d6a7dd1f403938d Author: Paweł Krawczyk AuthorDate: 2024-05-10 04:21:18 +0000 Commit: Warner Losh CommitDate: 2024-05-10 04:34:36 +0000 Explain cron.d Add details on the format of system cron files, which are mentioned in cron(8) which refers here but barely explained here. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1106 --- usr.sbin/cron/crontab/crontab.5 | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/usr.sbin/cron/crontab/crontab.5 b/usr.sbin/cron/crontab/crontab.5 index 12caa45cff46..e4e6fae0b01b 100644 --- a/usr.sbin/cron/crontab/crontab.5 +++ b/usr.sbin/cron/crontab/crontab.5 @@ -19,7 +19,7 @@ .\" .\" $Id: crontab.5,v 1.2 1998/08/14 00:32:38 vixie Exp $ .\" -.Dd March 29, 2020 +.Dd May 10, 2024 .Dt CRONTAB 5 .Os .Sh NAME @@ -151,11 +151,15 @@ usually does not read its mail. .Pp The format of a cron command is very much the V7 standard, with a number of upward-compatible extensions. -Each line has five time and date fields, -followed by a user name -(with optional ``:'' and ``/'' suffixes) -if this is the system crontab file, +.Pp +Each user cron line has five time and date fields, followed by a command. +.Pp +Each line in system crontab ( +.Pa /etc/crontab, /etc/cron.d, /usr/local/etc/cron.d +) has five time and date fields, followed by a valid user name +(with optional ``:'' and ``/'' suffixes), followed by a command. +.Pp Commands are executed by .Xr cron 8 when the minute, hour, and month of year fields match the current time, @@ -281,9 +285,15 @@ Note, however, that overlap may occur if the job is running when the file containing the job is modified and subsequently reloaded. The first run is scheduled for the specified number of seconds after cron is started or the crontab entry is reloaded. -.Sh EXAMPLE CRON FILE +.Sh EXAMPLE SYSTEM CRON FILE +.Bd -literal +# sample /etc/cron.d/vmstat +# run vmstat every five minutes +# note the username as sixth field! +*/5 * * * * root vmstat +.Ed +.Sh EXAMPLE USER CRON FILE .Bd -literal - # use /bin/sh to run commands, overriding the default set by cron SHELL=/bin/sh # mail any output to `paul', no matter whose crontab this is