in reply to Using Cron to Run Script
As I said, I haven't been able to test that to confirm that it will work in your situation, but the situation I had was very similar, and it worked for me.$logdir = "/whatdir/"; opendir(LOGDIR, $logdir) or die "Can't open $logdir: $!\n"; chdir $logdir; foreach $file ( grep {-f && (-M > 5)} readdir(LOGDIR) ) { unlink $file; } closedir(LOGDIR);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Using Cron to Run Script
by wileykt (Acolyte) on Dec 28, 2001 at 22:34 UTC | |
|
Re (tilly) 2: Using Cron to Run Script
by tilly (Archbishop) on Jan 05, 2002 at 19:06 UTC |