Okay.. this is the script I whipped up:
#!/usr/bin/perl use File::stat; use Time::localtime; print "Content-type: text/html\n\n"; chdir( "/home/sscripts/public_html/kage/" ); local( @files ) = <*.zip>; foreach $file( @files ) { if( !-d $file ) { $date = ctime( stat( $file ) -> mtime); print "$file $date<br>\n"; } } #unlink @files; #Use that (somehwat) to delete the ones #that have been existant for more than #48 hours...
I want it to first, forget about a file called blahblah.zip, so it doesn't even see that file, then I want it to delet all files older then 48 hours... this script is going to be put on a Cron so no need to worry about the autorun part. the way it displays files is as follows:
geh.zip Mon Nov 12 04:03:24 2001 htrw5u.zip Mon Nov 12 06:17:29 2001 bht5iw354uy.zip Mon Nov 12 04:35:26 2001 hy543yyr.zip Sun Nov 11 21:05:06 2001 htrswu6.zip Mon Nov 12 06:21:15 2001 htre6iu.zip Mon Nov 12 06:16:14 2001 h653hhtr.zip Mon Nov 12 04:55:10 2001 ht5ewu675.zip Mon Nov 12 06:17:13 2001 blahblah.zip Mon Nov 12 04:21:26 2001 remember.. I want it to completely disreguard blahblah.zip and NOT del +ete it, no matter what it's age..
Any ideas?

In reply to Deleting files older then 48 hours.. by Kage

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.