Deleting tens of thousands of files - very slow

Discussion in 'Site & Server Administration' started by macdesign, Dec 20, 2004.

  1. #1
    I have a site which was originally a static directory, and now is PHP, I still have the old directory there taking up space and not being used. I need to do some maintenance and get rid of it ASAP. I'm using FileZilla as the FTP client, and started it deleting the directory, but it's slow, it's been running for five hours so far and my guess is that it's going to take several days to delete everything. The directory structure is very complex with multiple levels.

    It seems for each deletion it has to issue a separate command to work down each level of the directory, then do the deletion, then refresh.
     
    macdesign, Dec 20, 2004 IP
  2. dkalweit

    dkalweit Well-Known Member

    Messages:
    520
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    150
    #2
    Do you have shell access to your account? If you can ssh/telnet in, you can issue a "rm -r -f" with the parent directory... Assuming *nix, of course.


    --
    Derek
     
    dkalweit, Dec 20, 2004 IP
  3. DarrenC

    DarrenC Peon

    Messages:
    3,386
    Likes Received:
    154
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I use WT FTP by Ipwich and deleted over 4,000 files in next to no time using this FTP, but I'm not sure how files you are looking to delete. It took about 15 minutes to delete 4,000.
     
    DarrenC, Dec 20, 2004 IP
  4. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #4
    Also try AceFTP -- there's a free version and I find it faster than WS_FTP.
     
    minstrel, Dec 20, 2004 IP
  5. macdesign

    macdesign Peon

    Messages:
    568
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    0
    #5
    macdesign, Dec 20, 2004 IP
  6. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #6
    I must say you've got more patience than me -- I wouldn't have waited anywhere near 5 hours :eek:
     
    minstrel, Dec 20, 2004 IP
  7. macdesign

    macdesign Peon

    Messages:
    568
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I wasn't waiting - I was sleeping ;) Had a late night yesterday trying to fix up a problem, and figured by the time I woke up [sleep deprived], it would have deleted everything. Anyway, with the PHP code, everything was deleted in less than an hour. Looks like there were well over 25,000 directories and 100,000 files.

    Unfortnately - it's not leading to a solution of my real problem, which is corrupted Front Page control files.
     
    macdesign, Dec 20, 2004 IP