foreach ( glob '*' ) { my $file_date = POSIX::strftime '%Y%m%d', localtime( ( stat )[ 9 ] + ); my $age = -M _; if ( $age >= 1 && $age < 2 ) { #rename Log File to .log.yyyymmdd rename $_, $_ . $file_date; } elsif ( $age > 14 ) { unlink $_; }
In reply to Re: Appending date to filename for Archiving
by jwkrahn
in thread Appending date to filename for Archiving
by viperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |