From: Mickey on
We just inherited a server that has a folder which contains millions
of old log files that need to be cleaned up.
Using the GUI to even view the folder, let alone to do anything in it
obviously just hoses the server with so many file handles.

We tried deleting files from the folder using a command prompt but ran
into similar issues.

I'm thinking maybe we can write a script that uses the folder's file
collection and read in maybe 500 file names at a time into an array.
Then we could then loop through the array and delete the files one at
a time, then read in another 500 and so on. This script could run over
a weekend and maybe finish by monday morning.

Problem is I've been focused on learning CF and SQL for the past year
and my VBS skills are a bit rusty. So I thought I would just see if
anyone has something close to this already that I could use as a
starting point.

Thanks.
From: mayayana on
You can try looping through the Files collection
and calling File.Delete on each one. you don't
need the intermediate step of an array. But....
maybe it'd be easier to just format and re-install.

> We just inherited a server that has a folder which contains millions
> of old log files that need to be cleaned up.
> Using the GUI to even view the folder, let alone to do anything in it
> obviously just hoses the server with so many file handles.
>
> We tried deleting files from the folder using a command prompt but ran
> into similar issues.
>
> I'm thinking maybe we can write a script that uses the folder's file
> collection and read in maybe 500 file names at a time into an array.
> Then we could then loop through the array and delete the files one at
> a time, then read in another 500 and so on. This script could run over
> a weekend and maybe finish by monday morning.
>
> Problem is I've been focused on learning CF and SQL for the past year
> and my VBS skills are a bit rusty. So I thought I would just see if
> anyone has something close to this already that I could use as a
> starting point.
>
> Thanks.


From: Mickey on
On Dec 8, 10:49 am, "mayayana" <mayaXXy...(a)rcXXn.com> wrote:
>  You can try looping through the Files collection
> and calling File.Delete on each one. you don't
> need the intermediate step of an array. But....
> maybe it'd be easier to just format and re-install.
>

Yeah I wish that was an option but this is a production web server and
it needs to stay up and running.
I guess I was just trying to find a way to limit the stress on the
master file table by deleting files in chunks. Not sure if that really
makes a difference or not. I thought maybe if I only open the files
collection long enough to grab 500 items and then close it, I might
leave more memory free to process the deletions. It's all just
theory... and very possibly overkill. I just need to avoid locking up
the server.
From: Pegasus [MVP] on

"Mickey" <xyxjunkmale(a)gmail.com> wrote in message
news:163687c0-45f6-4ca6-b765-7c3219aaa175(a)9g2000yqa.googlegroups.com...
> We just inherited a server that has a folder which contains millions
> of old log files that need to be cleaned up.
> Using the GUI to even view the folder, let alone to do anything in it
> obviously just hoses the server with so many file handles.
>
> We tried deleting files from the folder using a command prompt but ran
> into similar issues.

Could you be a little more specific and explain what exactly you mean with
"hosing the server", in particular when using console commands. Also - what
console command did you use?


From: Mickey on
On Dec 8, 11:23 am, "Pegasus [MVP]" <n...(a)microsoft.com> wrote:
> "Mickey" <xyxjunkm...(a)gmail.com> wrote in message
>
> Could you be a little more specific and explain what exactly you mean with
> "hosing the server", in particular when using console commands. Also - what
> console command did you use?

I am repeating what someone else told me... I have not tried this
myself but was just trying to offer them a solution based on what I
was told... that using the GUI (Windows Explorer) took an impossibly
long time to enumerate the files (longer than an hour) and after any
attempted action the process started over and eventually locked up the
server requiring a reboot.

It's moot now. Someone else is cleaning up the files though I wasn't
told how. But it seems to be working.
Thanks anyway.