Join the community today
Register Now

Sysadmin What is the quickest way to delete a LARGE folder?

Discussion in 'System Administration' started by rdan, Oct 9, 2022.

  1. rdan

    rdan Well-Known Member

    5,368
    1,348
    113
    May 25, 2014
    Ratings:
    +2,110
    Local Time:
    6:04 PM
    Mainline
    10.2
    It's large in terms of size, like 700GB+, and also has lots of content, I think more than 500K files.

    This folder is just a Nginx fascgi_cache folder, but the cache is stored for 60 days.


    The server is using a spinning HD, and doing rm -rf takes hours but hasn't even finished yet, causing the whole site to lag.
     
  2. cloud9

    cloud9 Premium Member Premium Member

    358
    100
    43
    Oct 6, 2015
    England
    Ratings:
    +184
    Local Time:
    10:04 AM
    1.23.2
    10.6.x
  3. rdan

    rdan Well-Known Member

    5,368
    1,348
    113
    May 25, 2014
    Ratings:
    +2,110
    Local Time:
    6:04 PM
    Mainline
    10.2
    Thanks, I was thinking about rsync but haven't tried it yet.
    I will try again later on non peak hours.
     
  4. eva2000

    eva2000 Administrator Staff Member

    49,737
    11,437
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,772
    Local Time:
    8:04 PM
    Nginx 1.21.x
    MariaDB 10.x
    Nice article - thanks for sharing :)

    Ouch. Maybe better just to put Cloudflare in front of the site and utilise Cloudflare Tiered Caching and Cache Rules
     
  5. rdan

    rdan Well-Known Member

    5,368
    1,348
    113
    May 25, 2014
    Ratings:
    +2,110
    Local Time:
    6:04 PM
    Mainline
    10.2
    Yes I am :D.
    But sometimes I need some major changes on the backend that I also need to purge all the cache (server side and CF) and it's pain for the main server for several hours until the cache build up.
     
  6. rdan

    rdan Well-Known Member

    5,368
    1,348
    113
    May 25, 2014
    Ratings:
    +2,110
    Local Time:
    6:04 PM
    Mainline
    10.2