From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 26 18:25:33 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFEB8106564A for ; Wed, 26 Nov 2008 18:25:33 +0000 (UTC) (envelope-from tutatnhamon@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by mx1.freebsd.org (Postfix) with ESMTP id 665AC8FC1B for ; Wed, 26 Nov 2008 18:25:33 +0000 (UTC) (envelope-from tutatnhamon@gmail.com) Received: by qw-out-2122.google.com with SMTP id 9so171667qwb.7 for ; Wed, 26 Nov 2008 10:25:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:mime-version:content-type:content-transfer-encoding :content-disposition:x-google-sender-auth; bh=6iR3rwhFw4U7UNnBmgn7upLpqBNqtTzSgcHXtWLRVgw=; b=OeSvVZsQ4Z0CTHawXS5TPBB3+OOL2I3JE8QOEY/YxF8GrWQ+OZvaL5a4whG17/iiJn +1+tQvi7vRI8WR1lEvCuewL2E2GLW0STDtnHwArMwst3xsGa/9vdbgOCEdQjHaBUFR97 FunHMgQuEEeAEooXzRwVsZ50gL+PwBLQE0aO8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition:x-google-sender-auth; b=cNQOJtylAttGRz5WA0r19qVDdLHCzSWfmD7ovr0WARWHdYrs1ICTaVDEZ4F6y41jeo 4COAZ5YiqsIWYYhe+OzAcN7ERG/DRBrVN/ZH44m2yU2qFb1DSVHD8li3OUNOH3JshcTW gnUDz2eqRLqd4vGDR0dqskrdRHVcN6QnkFOW0= Received: by 10.65.240.13 with SMTP id s13mr6504881qbr.29.1227722525755; Wed, 26 Nov 2008 10:02:05 -0800 (PST) Received: by 10.65.160.13 with HTTP; Wed, 26 Nov 2008 10:02:05 -0800 (PST) Message-ID: <65dfa4fc0811261002w61224c0ey9ed987f3f8122db0@mail.gmail.com> Date: Wed, 26 Nov 2008 20:02:05 +0200 From: "Artem Naluzhnyy" Sender: tutatnhamon@gmail.com To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: e220d33a24487a24 Subject: crontab(5) enhancements X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Nov 2008 18:25:33 -0000 Hi, I have two suggestion for newsyslog(8) and periodic(8) entries in default /etc/crontab file: * nice(1) newsyslog and periodic entries to shape CPU load spikes; * lockf(1) them to prevent simultaneous execution. So instead 1 3 * * * root periodic daily there may be 1 3 * * * root lockf -t0 /var/run/periodic.daily.lock nice -20 periodic daily In case of collision we'll receive following email: Date: Wed, 26 Nov 2008 18:16:00 +0200 (EET) From: root@tut.at.home (Cron Daemon) To: root@tut.at.home Subject: Cron lockf -t0 /var/run/periodic.daily.lock nice -20 periodic daily lockf: /var/run/periodic.daily.lock: already locked The configuration has been working for years on my servers without any visible drawbacks. What do you think? -- Artem Naluzhnyy