SUMMARY: creating a filename with yesterdays date.

From: Jim Kurtenbach <KurtenbachJ_at_crlcorp.com>
Date: Tue, 26 Nov 2002 11:38:03 -0600

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_at_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.
Received on Tue Nov 26 2002 - 17:38:54 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:43 NZDT