Written by James McDonald

January 5, 2009

service squid stop
rm -rf /var/spool/squid/* (removes cached files and directory structure)
rm -rf /var/log/squid/* (removes the logs)
squid -z (recreates the cache_dir structure)
service squid start

Doing the above can be helpful if you want to claw back some diskspace in a hurry.

If you wanted to shift the squid cache_dir you could edit squid.conf cache_dir to repoint it to another disk/partition before restarting.


  1. Leon

    use mv for shorter down time

    service squid stop
    mv /var/spool/squid /var/spool/squidold
    mv /var/log/squid/* /var/spool/squidold
    squid -z
    service squid start
    rm -rf /var/spool/squidold

  2. Leon

    If your disk is full, the squid -z will fail

    you can start the rm -rf for a few, then kill it, go back to squid -z, then complete rm -rf later


Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…