SUMMARY: creating a filename with yesterdays date.

From: Jim Kurtenbach (KurtenbachJ@crlcorp.com)
Date: Tue Nov 26 2002 - 12:38:03 EST


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.



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:49:00 EDT