viperl has asked for the wisdom of the Perl Monks concerning the following question:
chdir $main::logFolder or die "can't cd"; # I am not sure what to populate here for $yesterday $Yesterday; foreach (glob("*")) { $age = -M; if ($age==1) { #rename Log File to .log.yyyymmdd rename ($_, $_ .$Yesterday" } else if($age > 14) { unlink $_; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Appending date to filename for Archiving
by jwkrahn (Abbot) on Jun 29, 2009 at 12:24 UTC | |
by viperl (Initiate) on Jun 29, 2009 at 13:38 UTC | |
by jwkrahn (Abbot) on Jun 29, 2009 at 14:46 UTC | |
|
Re: Appending date to filename for Archiving
by CountZero (Bishop) on Jun 29, 2009 at 13:44 UTC | |
by viperl (Initiate) on Jun 30, 2009 at 10:11 UTC | |
by viperl (Initiate) on Jul 06, 2009 at 06:52 UTC |