Announcement

Collapse
No announcement yet.

How to delete a lot of files quickly

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to delete a lot of files quickly

    Ok, here's a new one.

    I have a customer that was running their own web server. They did a server upgrade recently and accidentally left their SMTP relay wide open by not reconnecting their server through their firewall.

    They've fixed the problem but are now stuck with so many files in their inetpub/mailroot/queue and inetpub/mailroot/badmail folders that explorer literally hangs when you browse to those directories. They want to clear those directories out before they restart the SMTP service.

    I've got remote desktop access to their server and I've tried deleting the files via a command prompt and using the "del" command. It's been running for about an hour without finishing.

    I've got no idea how many files are in the directories but it's a lot. I tried a dir command and let it run for several minutes before killing the command with a ^X.

    I'm wondering if anyone has any ideas for clearing out these directories? Remember that they are on my client's production web server. I can't really install anything on it. BTW, it's running Windows Server 2003.

    Any suggestions?
    P.S. You've been Spanked!

  • #2
    deltree and then just md to create the directories anew?

    AZ
    There's an Opera in my macbook.

    Comment


    • #3
      it's worth a shot.
      P.S. You've been Spanked!

      Comment


      • #4
        well I guess deltree doesn't exist in windows 2003. Del seems to work fine on directories now.

        I've tried it. It's running. It doesn't seem to be any faster.

        Any more ideas?
        P.S. You've been Spanked!

        Comment


        • #5
          I think maybe doing it locally could be faster - maybe doing it remotely it sends status data back and forth for every file? Create a .bat and just write the command in there, append "> NUL" (<span style="font-family: monospace;">del directory > NUL</span>) and execute it?

          AZ
          There's an Opera in my macbook.

          Comment


          • #6
            You know, I hadn't thought about deleting the directory and the recreating it. I'd only thought about deleting the files.

            I am able to browse in explorer to the inetpub/mailroot folder. From there I tried deleting the two directories in question. The Queue directory is already gone. It's still thinking about the badmail directory, but this seems to be a fast approach.
            P.S. You've been Spanked!

            Comment


            • #7
              Originally posted by az
              I think maybe doing it locally could be faster - maybe doing it remotely it sends status data back and forth for every file? Create a .bat and just write the command in there, append "> NUL" (<span style="font-family: monospace;">del directory > NUL</span>) and execute it?

              AZ
              Remote desktop should be 'doing it locally" and only sending me screen updates. Hopefully, explorer won't take too much longer to clear out the badmail directory and I can go home.
              P.S. You've been Spanked!

              Comment


              • #8
                I've noticed many DOS programs run A LOT faster when they're maximized (ALT+Enter), dunno if this only applies when they have to update the screen, but it's really more than 10x faster maximized.

                AZ
                There's an Opera in my macbook.

                Comment


                • #9
                  hehe...that would not happen in linux ( could not resist)

                  try

                  del /s /f *

                  That should delete all files and subdirecories (including readonly)

                  Comment


                  • #10
                    Originally posted by Marshmallowman
                    hehe...that would not happen in linux ( could not resist)

                    try

                    del /s /f *

                    That should delete all files and subdirecories (including readonly)
                    I was waiting for that...

                    If you configure linux with open relay by mistake, which is what my customer did, then it would happen.

                    Explorer is still "preparing to delete" the "badmail" directory. I'm watching the process in task manager and it's slowly sucking up memory while it "thinks". It's up to 154MB in use for explorer alone. I hope it doesn't run out of resources and crash explorer. There are live sites running on the web server right now and I'd hate to have to reboot the box.

                    Az made a good point about Dos boxes. I was considering pressing the cancel button and trying his suggestion, but it just now stopped thinking and is actually deleting files. It says that there are 230 minutes remaining! Imagine how many files that is. I hope it doesn't actually take that long. I've disabled the recycle bin and the antivirus software on the server until this completes.
                    P.S. You've been Spanked!

                    Comment


                    • #11
                      actually I think his reference was to the issues you are having with the delete process, as well as directory listings.

                      As well as a nice ssh shell being a sweety thing to use.
                      Juu nin to iro


                      English doesn't borrow from other languages. It follows them down dark alleys, knocks them over, and goes through their pockets for loose grammar.

                      Comment


                      • #12
                        Oi vey...

                        Why do we even have to go there?

                        Sure there probably would be a better solution to my problem if I was running Linux AND I had the right software installed.

                        How much do you want to bet that there's a better explorer type app for windows that I could have installed on the server and would have taken care of my problem much more quickly?

                        The point is I didn't want to install anything.

                        Should I be pointing out that "you wouldn't have that problem with Windows" everytime someone posts about not being able to install basic drivers in linux? Or when someone complains that they didn't install the components of some new distro in exactly the right order and things aren't working right? Of course not!
                        P.S. You've been Spanked!

                        Comment


                        • #13
                          Actually, it's more a reference to command line.

                          Not sure if 2k3 has an ssh implimentation. but there is very little you can not do from the command line in windows that you can do from the UI. and you get to do it without the UI overhead.

                          So my comment about ssh is really not platform specific, there are ssh shells avaliable though you might have to install one.
                          Juu nin to iro


                          English doesn't borrow from other languages. It follows them down dark alleys, knocks them over, and goes through their pockets for loose grammar.

                          Comment


                          • #14
                            Originally posted by Sasq
                            there are ssh shells avaliable though you might have to install one.
                            There's the rub.
                            P.S. You've been Spanked!

                            Comment


                            • #15
                              well telnet is there by default, though thankfully the service is at least turned off by default as well.
                              Juu nin to iro


                              English doesn't borrow from other languages. It follows them down dark alleys, knocks them over, and goes through their pockets for loose grammar.

                              Comment

                              Working...
                              X