I'm not in a windows environment right now, so I can't test whether stat works with UNC specifications, but with a bit of luck the following will let you test for files that are older than seven days (otherwise there's undoubtably a Win32 module that does it for you):

my $age = (stat $remote)[9]; my $cutoff = time - 86400 * 7; # now less 7 days if( $age < $cutoff ) { # file is older }

A more compact way of creating the filename (and this is the third time in a week I think I've suggested this) you can do the following:

my $dirname = sub { sprintf '%02d%02d%02d%02d%02d%02d', $_[0] % 100, @_[1..5] }->((localtime)[5,4,3,2,1,0]);

It may look complicated, but it saves on all those pesky intermediate variables.


print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'

In reply to Re: Moving log files, create folder based on local time/date & zip them up based on local time & date. by grinder
in thread Moving log files, create folder based on local time/date & zip them up based on local time & date. by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.