Welcome to WebmasterWorld Guest from 54.196.107.244

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

To delete a file once a week?

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 4, 2000
posts:1324
votes: 0


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";
}

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

Administrator

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

joined:July 24, 2001
posts:15756
votes: 0


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?

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

Senior Member

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

joined:Apr 22, 2000
posts:9138
votes: 0


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

[webmasterworld.com...]

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

Junior Member

10+ Year Member

joined:Mar 9, 2003
posts:167
votes: 0


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

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members