HOWTO: clear squid cache

systemctl stop squid
# OR:
# squid -k shutdown
#
# check status
systemctl status squid
# set cache directory
CACHEDIRSQ="$(grep cache_dir /etc/squid/squid.conf | awk '$1 ~ /#.*/ {print $3"/*"}')"
# clean
read -p "Are you sure? " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
 rm -fr "${CACHEDIRSQ}"
 # rebuild swap directories
 squid -z
fi
# start
systemctl start squid
systemctl status squid
Реклама