From owner-freebsd-questions@FreeBSD.ORG Thu Dec 5 13:41:48 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84D6BE25 for ; Thu, 5 Dec 2013 13:41:48 +0000 (UTC) Received: from mail-wg0-x236.google.com (mail-wg0-x236.google.com [IPv6:2a00:1450:400c:c00::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3881D8B for ; Thu, 5 Dec 2013 13:41:47 +0000 (UTC) Received: by mail-wg0-f54.google.com with SMTP id n12so15787399wgh.9 for ; Thu, 05 Dec 2013 05:41:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; bh=x9HNrjf/fq1pZXjEa6JwagZ2XM1EjBPN5jprc6CYIX0=; b=wJnmlXA3Kt9MEvr5Y5MGXl0XBddl3lSFbODbhHIfGeHC4iCRN4ja5kvCilfxHsdsBm NUrOtRJEfVLH0h4QElN5TvqkipBNXtjrv4ZfyzMXXHwfkecLfTOXkB8QLx9EWuoK9z05 +QDERAXFk0Qq9COBlruum9yZ/fX5UfHql+vHOJuHT3gL8RxD+Ifhp/3naI+akljm5DJB Yn0sybelSgeAeORVPeMe5sR8Q8J1OKugMcasSLp8b0TpBn8s8JIYPchgi8DU1JX1bukd 4Ynv3vsZ8MkGg5P6z4kiFy89YMSmh7mmAS/0vtrYE/TcdpQ0JFNOFyNN6UjeyUrTd7vy 8Vgg== X-Received: by 10.180.85.42 with SMTP id e10mr12136752wiz.1.1386250906375; Thu, 05 Dec 2013 05:41:46 -0800 (PST) Received: from gumby.homeunix.com (87-194-105-247.bethere.co.uk. [87.194.105.247]) by mx.google.com with ESMTPSA id n6sm6429001wix.3.2013.12.05.05.41.44 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Thu, 05 Dec 2013 05:41:45 -0800 (PST) Date: Thu, 5 Dec 2013 13:41:42 +0000 From: RW To: freebsd-questions@freebsd.org Subject: Re: System reboots ~3am during daily periodic 450.status-security run Message-ID: <20131205134142.3d6ad8d5@gumby.homeunix.com> In-Reply-To: <201312050008.54995.freebsd01@dgmm.net> References: <201312012352.01075.freebsd01@dgmm.net> <201312031144.40570.freebsd01@dgmm.net> <529E6F80.7050705@ShaneWare.Biz> <201312050008.54995.freebsd01@dgmm.net> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.19; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Dec 2013 13:41:48 -0000 On Thu, 5 Dec 2013 00:08:54 +0000 dgmm wrote: > On Tuesday 03 December 2013 23:55:44 Shane Ambler wrote: > > On 03/12/2013 22:14, dgmm wrote: > > > On Tuesday 03 December 2013 09:48:04 krad wrote: > > >> or you could use the @reboot option, that would mean it always > > >> runs at crons start, which may not be what you want, > > > > > > Yes, that was my first thought but the overheads at boot time > > > might be inconvenient although I'll try it to find out. > > > > Or write a rc script to run it at shutdown? > > Thanks. That's the answer I was looking for. There's no downside. Be aware that shutdown runs under a timeout. IIWY I'd install anacron, it a tiny binary, and it's designed for the problem you have. I'll run any number of tasks with arbitrary periodicity (in days), so it'll handle weekly and monthly scripts as well. It uses locking so you can run it from rc.d, cron or manually without having to worry about races. It can run it's tasks with staggered delays or serialize them.