From owner-freebsd-questions@FreeBSD.ORG Fri Dec 7 18:55:50 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CC7B16A417 for ; Fri, 7 Dec 2007 18:55:50 +0000 (UTC) (envelope-from drew@mykitchentable.net) Received: from qsmtp4.mc.surewest.net (qsmtp.mc.surewest.net [66.60.130.145]) by mx1.freebsd.org (Postfix) with SMTP id 7F7D413C45B for ; Fri, 7 Dec 2007 18:55:49 +0000 (UTC) (envelope-from drew@mykitchentable.net) Received: (qmail 21921 invoked from network); 7 Dec 2007 10:55:48 -0800 Received: by simscan 1.1.0 ppid: 21877, pid: 21878, t: 11.1892s scanners: regex: 1.1.0 attach: 1.1.0 spam: 3.1.7-deb X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on qsmtp4.surewest.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.1.7-deb Received: from unknown (HELO blacklamb.mykitchentable.net) (66.205.146.210) by qsmtp4 with SMTP; 7 Dec 2007 10:55:37 -0800 Received: from [192.168.35.6] (unknown [192.168.35.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by blacklamb.mykitchentable.net (Postfix) with ESMTP id 55B9A1648D2; Fri, 7 Dec 2007 10:55:35 -0800 (PST) Message-ID: <47599726.1070807@mykitchentable.net> Date: Fri, 07 Dec 2007 10:55:34 -0800 From: Drew Tomlinson User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Kevin Kinsey , FreeBSD Questions References: <4759849F.8000603@mykitchentable.net> <475995B1.90504@daleco.biz> In-Reply-To: <475995B1.90504@daleco.biz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: Help with Crontab X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2007 18:55:50 -0000 On 12/7/2007 10:49 AM Kevin Kinsey wrote: > Drew Tomlinson wrote: >> I'm trying to use cron to run a script on the first Sunday of every >> month at 0930. I used this entry in the crontab: >> >> # Run 1st Sunday at 0930 - Fulls >> 30 9 1-7 * 7 /usr/local/scripts/backup_bootstrap.sh >> >> Yet this script just ran on Thursday, December 6 at 0930. Why? I >> just added it to cron so I don't know if it will run on any other days. >> > > See crontab(5), which says: > > Note: The day of a command's execution can be specified by two fields -- > day of month, and day of week. If both fields are restricted (ie, > are > not *), the command will be run when either field matches the current > time. For example, ``30 4 1,15 * 5'' would cause a command to be > run at > 4:30 am on the 1st and 15th of each month, plus every Friday. > > HTH, > > Kevin Kinsey > Thank you for the reply. Now I see the light. :) So I suppose there is no way to schedule as I wish using cron. I suspect I'll have to modify my script to do the date checking and only execute the "meat" if it's the right date. Thanks, Drew -- Be a Great Magician! Visit The Alchemist's Warehouse http://www.alchemistswarehouse.com