From owner-freebsd-questions@FreeBSD.ORG Fri Jul 4 22:43:37 2003 Return-Path: <owner-freebsd-questions@FreeBSD.ORG> Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CF55637B401 for <freebsd-questions@freebsd.org>; Fri, 4 Jul 2003 22:43:37 -0700 (PDT) Received: from web41409.mail.yahoo.com (web41409.mail.yahoo.com [66.218.93.75]) by mx1.FreeBSD.org (Postfix) with SMTP id 658CA43FBD for <freebsd-questions@freebsd.org>; Fri, 4 Jul 2003 22:43:37 -0700 (PDT) (envelope-from davemac11@yahoo.com) Message-ID: <20030705054337.21573.qmail@web41409.mail.yahoo.com> Received: from [67.241.59.176] by web41409.mail.yahoo.com via HTTP; Fri, 04 Jul 2003 22:43:37 PDT Date: Fri, 4 Jul 2003 22:43:37 -0700 (PDT) From: Dave McCammon <davemac11@yahoo.com> To: Chuck Swiger <cswiger@mac.com> In-Reply-To: <3F04CE32.6040204@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: freebsd-questions@freebsd.org Subject: Re: crontab same time execution order X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions <freebsd-questions.freebsd.org> List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>, <mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions> List-Post: <mailto:freebsd-questions@freebsd.org> List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help> List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>, <mailto:freebsd-questions-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 05 Jul 2003 05:43:38 -0000 --- Chuck Swiger <cswiger@mac.com> wrote: > Dave McCammon wrote: > > If two entries in the crontab are for the same > time, > > which entry gets ran first? > > It's not deterministic, or if it happens to be so > under FreeBSD, it's not on > other platforms and you should not rely on a > particular order. > > If you've got commands which depend on each other in > cron, do something like: > > command1 ; command2 ; command3 > > ...or... > > command1 && command2 && command3 > Thanks for the reply. Basically, what I am looking for is to get a command to run right before newsyslog rotates a log file(awstats and apache log file. After I sent the message, I started playing with /etc/crontab and noticed that the lower on the list the sooner the command would run (per /var/log/cron) in comparison with a command set to run at the same time. What I did was put an 'echo' command above the newsyslog entry, restarted cron,waited for top of hour, checked log, moved command below the newsyslog entry, restarted cron, waited for top of hour and checked log file. The command ran before cron when listed lower and then ran after when command was listed above the newsyslog entry. I also noticed that when the 'atrun' command runs at the top of the hour, it will run after the newsyslog entry and newsyslog is listed lower in the /etc/crontab file. Perhaps this predictable behavior is in FreeBSD only. (I don't have access to other platforms). Or perhaps my simple test was too simple. It just seemed to be too predictable to not at least try to get some feed back. __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com