From owner-freebsd-stable@FreeBSD.ORG Wed Apr 16 04:09:15 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 137E4106566B for ; Wed, 16 Apr 2008 04:09:15 +0000 (UTC) (envelope-from eugen@kuzbass.ru) Received: from www.svzserv.kemerovo.su (www.svzserv.kemerovo.su [213.184.65.80]) by mx1.freebsd.org (Postfix) with ESMTP id 68DE88FC1B for ; Wed, 16 Apr 2008 04:09:13 +0000 (UTC) (envelope-from eugen@kuzbass.ru) Received: from www.svzserv.kemerovo.su (eugen@localhost [127.0.0.1]) by www.svzserv.kemerovo.su (8.13.8/8.13.8) with ESMTP id m3G47R0P094237; Wed, 16 Apr 2008 12:07:27 +0800 (KRAST) (envelope-from eugen@www.svzserv.kemerovo.su) Received: (from eugen@localhost) by www.svzserv.kemerovo.su (8.13.8/8.13.8/Submit) id m3G47I04094233; Wed, 16 Apr 2008 12:07:18 +0800 (KRAST) (envelope-from eugen) Date: Wed, 16 Apr 2008 12:07:18 +0800 From: Eugene Grosbein To: Miguel Lopes Santos Ramos Message-ID: <20080416040718.GA93141@svzserv.kemerovo.su> References: <200804152341.m3FNfZNH021951@satan.anjos.strangled.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200804152341.m3FNfZNH021951@satan.anjos.strangled.net> User-Agent: Mutt/1.4.2.3i Cc: freebsd-stable@freebsd.org Subject: Re: /etc/daily.local and sim. never run X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2008 04:09:15 -0000 On Wed, Apr 16, 2008 at 12:41:35AM +0100, Miguel Lopes Santos Ramos wrote: > I just noticed that scripts in /etc/daily.local, /etc/weekly.local, etc, > never run. > The reason seems to be that the /etc/periodic/daily/999.local and similar > scripts use "for script in $daily_local". Because the variable $daily_local > is initialized in /etc/defaults/periodic.conf to /etc/daily.local, which > actually does not contain a wildcard, the for loop step executes only once > with the variable script bound to "/etc/daily.local". There's no iteration > over scripts contained in /etc/daily.local. /etc/daily.local was never supposed to be a directory, it always was a file from very early ages. I still use it this way :-) > I have no idea when this might have gotten broken. The 999.local scripts > date back to 2001. It's curious that no one has noticed. > Perhaps most people just use the crontab or put their scripts directly into > /etc/periodic/daily, etc. /usr/local/etc/periodic/daily should be used for own periodic jobs. > Anyway, scheduling things in crontabs and the like is not very good when > the system is not always on. > Since UNIX is no longer such a "time sharing system" and many people run > desktops and part-time servers, wouldn't it be desirable to have a periodic > job scheduling mechanism that would reliably run jobs when a given amount > of time (uptime or not) had passed? I just include a line at start of script job: echo "$0" "$@" | at 6:00 tomorrow So, this script will be called next day, 6:00 or, if desktop'll be turned on later in the morning, the job runs just after boot. "At" scheduler will take care of the rest: current directory for job and environment, it keeps them safe. Eugene Grosbein