From owner-freebsd-newbies Sun Aug 15 7:10:16 1999 Delivered-To: freebsd-newbies@freebsd.org Received: from avarice.riverstyx.net (hq-port-89.harbour-dhcp-pool.infinetgroup.com [207.23.37.89]) by hub.freebsd.org (Postfix) with ESMTP id 62E78151C8 for ; Sun, 15 Aug 1999 07:09:54 -0700 (PDT) (envelope-from unknown@riverstyx.net) Received: from avarice (unknown@avarice [10.0.0.2]) by localhost.localdomain (8.9.3/8.9.3) with ESMTP id MAA07759; Mon, 2 Aug 1999 12:27:20 -0700 Date: Mon, 2 Aug 1999 12:27:20 -0700 (PDT) From: Tani Hosokawa To: Istvan & Agra Baroti Cc: freebsd-newbies@FreeBSD.ORG Subject: Re: need short unix program In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-newbies@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Oops. I read minutes. #!/usr/bin/perl while (1) { if (fork) { sleep 10; } else { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $filename = sprintf "%04i-%02i-%02i.jpg", $year+1900, $mon+1, $mday; system "cp /usr/whatever /usr/newplace/$filename"; # could have used 'system "cp /usr/whatever /usr/newplace/`date +%Y-%m-%d`.jpg' # but that's ugly. and if you want to step up the pace, spawning a date # process every second might be bad for you (dunno your machine's # capacity). } } On Mon, 2 Aug 1999, Istvan & Agra Baroti wrote: > > > On Mon, 2 Aug 1999, Tani Hosokawa wrote: > > > cron job... > > crontab doesn't repeat processes lasting less than 1 minute. > and I need to repeat the copy process every 10 seconds. > > yours, > baroti > --- tani hosokawa river styx internet To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-newbies" in the body of the message