From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jim Kurtenbach Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: creating a filename with yesterdays date. Date: Tue, 26 Nov 2002 11:38:03 -0600 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: main.gmane.org 1038332189 7392 80.91.224.249 (26 Nov 2002 17:36:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 26 Nov 2002 17:36:29 +0000 (UTC) Cc: Thad Guardado Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 18GjdL-0001v6-00 for ; Tue, 26 Nov 2002 18:36:27 +0100 Original-Received: (qmail 32117 invoked by uid 5); 26 Nov 2002 17:38:24 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 32108 invoked by uid 49493); 26 Nov 2002 17:38:24 -0000 Original-Received: from KurtenbachJ@crlcorp.com by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.51. spamassassin: 2.50-cvs. Clear:SA:0(-1.3/5.0):. Processed in 0.408557 secs); 26 Nov 2002 17:38:24 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (160.91.4.119) by 0 with SMTP; 26 Nov 2002 17:38:23 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H6700CHE2BUX2@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Tue, 26 Nov 2002 12:38:22 -0500 (EST) Original-Received: from mailsvr1.crlcorp.com (mailsvr1.crlcorp.com [12.30.162.228]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H6700ECH2BP64@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Tue, 26 Nov 2002 12:38:14 -0500 (EST) Original-Received: by mailsvr1.crlcorp.com with Internet Mail Service (5.5.2655.55) id ; Tue, 26 Nov 2002 11:38:13 -0600 Content-return: allowed Original-To: Tru64 Mailing List X-Mailer: Internet Mail Service (5.5.2655.55) Xref: main.gmane.org gmane.os.tru64.managers:2573 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:2573 Quite a while ago I asked for suggestions on how to create a log file with yesterdays date as part of the name. In this particular case we collect performance data all day and generate a summary shortly after midnight. We wanted the filename to reflect the day that the data was collected. Several people responded with many excellent suggestions. Unfortunately, I didn't keep track of the contributors. A very special Thank You is due for all those that responded!! This is how the solution finally ended up looking: ======================================= #!/usr/local/bin/perl use POSIX; $date = strftime"%e%b%Y",localtime(time-86400); $date =~ s/\s+//; open OUT,">>/var/opt/pm/data1/$date"; close OUT; ======================================= James Kurtenbach Clinical Reference Laboratory 8433 Quivira Lenexa, KS 66215 (913) 693 2508 (direct) (913) 492 3652 (operator assisted) kurtenbachj@crlcorp.com DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Thank you.