Welcome to WebmasterWorld Guest from 54.226.32.234

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

To delete a file once a week?

     

stcrim

1:07 am on Jul 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the following deletes all the files in a folder, is there an easy way to delete a single file from a folder once a week?

-s-

#!/usr/bin/perl
$path="/www/mysite/ad";
opendir(FP,"$path");
@del=readdir(FP);
closedir(FP);
foreach $i (@del) {
unlink "$path/$i";
}

jatar_k

1:56 am on Jul 25, 2003 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



you could set it up as a crontab

G search brings up a bunch of docs, couldn't decide on one suitable to post.

<added>just realized you may mean the code
Does it have a set name?

rcjordan

2:04 am on Jul 25, 2003 (gmt 0)

WebmasterWorld Senior Member rcjordan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



wonder if there is anything to cannibalize out of this thread?

[webmasterworld.com...]

StopSpam

2:11 pm on Jul 25, 2003 (gmt 0)

10+ Year Member



Yeh we just had discussed this question
as i earlyer this month had asked nearly same question and and solution ...
 

Featured Threads

Hot Threads This Week

Hot Threads This Month