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:#!/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...
Any ideas?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..
In reply to Deleting files older then 48 hours.. by Kage
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |