How:
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
Why:
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.
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
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