Deleting multiple (like 500+) files very slow using FTP?

Discussion in 'Site & Server Administration' started by Kerosene, Jan 17, 2008.

  1. #1
    I have a cronjob that empties a cache directory every day, but sometimes I empty the directory manually (like before I make a site backup) and it takes FOREVER to empty the directory. There's usually around 500 small files in the directory. It takes just as long if I select the directory as when I select all the files.

    Is there a faster way to do this?
     
    Kerosene, Jan 17, 2008 IP
  2. rllunzmann

    rllunzmann Active Member

    Messages:
    1,796
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    80
    #2
    possibly have your host do it from the console (would be faster)
     
    rllunzmann, Jan 18, 2008 IP
  3. Denn

    Denn Peon

    Messages:
    76
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You could try deleting it using PHP, but I think doing by console (SSH) like rllunzmann said would be faster.
     
    Denn, Jan 19, 2008 IP
  4. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #4
    Even use cpanel file manager

    or if you are removing all files in a folder or using wild card you can write a simple php program which can do this very fast

    Regards

    Alex
     
    kmap, Jan 19, 2008 IP
  5. oc-scott

    oc-scott Active Member

    Messages:
    420
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    68
    #5
    Contact your webhost to have a shell access for your account, then you will be able to empty the cache folder much faster.
     
    oc-scott, Jan 19, 2008 IP
  6. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #6
    Thanks for the tips everyone. I think I'll just continue to use FTP. It's not such a big deal... I was just hoping that there was a faster way of doing it using FTP. I don't want to mess around with shell access, I'm likely to screw things up big time :p
     
    Kerosene, Jan 21, 2008 IP
  7. kendo1979

    kendo1979 Peon

    Messages:
    208
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    ftp goes back and forth communicating confirmation between your server and your ftp program, that's why it took such a long time. console (ssh) will be best.
     
    kendo1979, Jan 21, 2008 IP
  8. wmghori

    wmghori Well-Known Member

    Messages:
    1,061
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    160
    #8
    try winscp, it might speed up things.
     
    wmghori, Jan 21, 2008 IP