Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Sun Feb 05, 2023 11:35 pm


Username:
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
 
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation code
Confirmation code:
In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.
     

Topic review - Squid clear cache on FreeBSD
Author Message
Post subject: Squid clear cache on FreeBSD  |  Post Posted: Mon Mar 03, 2014 7:37 am
Based on squid documentation:
http://wiki.squid-cache.org/SquidFaq/OperatingSquid#I_want_to_restart_Squid_with_a_clean_cache

To clear / reset squid cache on FreeBSD (sometimes cache directory can grow very big), first shutdown squid:
Code:
# /usr/local/etc/rc.d/squid stop
Stopping squid.
Waiting for PIDS: 1650.


Move old cache directory and create new one. Make sure same permissions are set on new one:
Code:
# cd /var/squid/
# ls -la
total 32
drwxrwxr-x   8 squid  squid   512 Mar  3 11:30 .
drwxr-xr-x   7 root   wheel  1024 Mar  3 10:31 ..
drwxr-xr-x   2 squid  squid   512 Apr 25  2013 ca_path
drwxr-x---  67 squid  squid  1024 Apr 26  2013 cache
drwxr-xr-x   3 squid  squid   512 May  1  2013 lib
drwxr-x---   2 squid  squid   512 Sep  4  2012 logs
drwxr-xr-x   2 squid  squid   512 Mar  3 11:31 swap
# mv cache cache.old
# mkdir cache
# chown squid:squid cache
# chmod 750 cache
# ls -la
total 32
drwxrwxr-x   8 squid  squid   512 Mar  3 11:30 .
drwxr-xr-x   7 root   wheel  1024 Mar  3 10:31 ..
drwxr-xr-x   2 squid  squid   512 Apr 25  2013 ca_path
drwxr-x---   2 squid  squid   512 Mar  3 11:30 cache
drwxr-x---  67 squid  squid  1024 Apr 26  2013 cache.old
drwxr-xr-x   3 squid  squid   512 May  1  2013 lib
drwxr-x---   2 squid  squid   512 Sep  4  2012 logs
drwxr-xr-x   2 squid  squid   512 Mar  3 11:31 swap


Next, initialize the new cache directory:
Code:
# squid -z
# 2014/03/03 11:35:11 kid1| Creating missing swap directories
2014/03/03 11:35:11 kid1| /var/squid/cache exists
2014/03/03 11:35:11 kid1| Making directories in /var/squid/cache/00
2014/03/03 11:35:11 kid1| Making directories in /var/squid/cache/01
2014/03/03 11:35:12 kid1| Making directories in /var/squid/cache/02
2014/03/03 11:35:12 kid1| Making directories in /var/squid/cache/03
2014/03/03 11:35:12 kid1| Making directories in /var/squid/cache/04
2014/03/03 11:35:13 kid1| Making directories in /var/squid/cache/05
2014/03/03 11:35:15 kid1| Making directories in /var/squid/cache/06
2014/03/03 11:35:16 kid1| Making directories in /var/squid/cache/07
2014/03/03 11:35:17 kid1| Making directories in /var/squid/cache/08
2014/03/03 11:35:19 kid1| Making directories in /var/squid/cache/09
2014/03/03 11:35:19 kid1| Making directories in /var/squid/cache/0A
2014/03/03 11:35:21 kid1| Making directories in /var/squid/cache/0B
2014/03/03 11:35:21 kid1| Making directories in /var/squid/cache/0C
2014/03/03 11:35:21 kid1| Making directories in /var/squid/cache/0D
2014/03/03 11:35:22 kid1| Making directories in /var/squid/cache/0E
2014/03/03 11:35:23 kid1| Making directories in /var/squid/cache/0F
2014/03/03 11:35:24 kid1| Making directories in /var/squid/cache/10
2014/03/03 11:35:24 kid1| Making directories in /var/squid/cache/11
2014/03/03 11:35:25 kid1| Making directories in /var/squid/cache/12
2014/03/03 11:35:26 kid1| Making directories in /var/squid/cache/13
2014/03/03 11:35:26 kid1| Making directories in /var/squid/cache/14
2014/03/03 11:35:27 kid1| Making directories in /var/squid/cache/15
2014/03/03 11:35:29 kid1| Making directories in /var/squid/cache/16
2014/03/03 11:35:29 kid1| Making directories in /var/squid/cache/17
2014/03/03 11:35:30 kid1| Making directories in /var/squid/cache/18
2014/03/03 11:35:30 kid1| Making directories in /var/squid/cache/19
2014/03/03 11:35:31 kid1| Making directories in /var/squid/cache/1A
2014/03/03 11:35:31 kid1| Making directories in /var/squid/cache/1B
2014/03/03 11:35:32 kid1| Making directories in /var/squid/cache/1C
2014/03/03 11:35:32 kid1| Making directories in /var/squid/cache/1D
2014/03/03 11:35:33 kid1| Making directories in /var/squid/cache/1E
2014/03/03 11:35:33 kid1| Making directories in /var/squid/cache/1F
2014/03/03 11:35:34 kid1| Making directories in /var/squid/cache/20
2014/03/03 11:35:35 kid1| Making directories in /var/squid/cache/21
2014/03/03 11:35:36 kid1| Making directories in /var/squid/cache/22
2014/03/03 11:35:36 kid1| Making directories in /var/squid/cache/23
2014/03/03 11:35:36 kid1| Making directories in /var/squid/cache/24
2014/03/03 11:35:36 kid1| Making directories in /var/squid/cache/25
2014/03/03 11:35:37 kid1| Making directories in /var/squid/cache/26
2014/03/03 11:35:37 kid1| Making directories in /var/squid/cache/27
2014/03/03 11:35:38 kid1| Making directories in /var/squid/cache/28
2014/03/03 11:35:39 kid1| Making directories in /var/squid/cache/29
2014/03/03 11:35:40 kid1| Making directories in /var/squid/cache/2A
2014/03/03 11:35:41 kid1| Making directories in /var/squid/cache/2B
2014/03/03 11:35:41 kid1| Making directories in /var/squid/cache/2C
2014/03/03 11:35:41 kid1| Making directories in /var/squid/cache/2D
2014/03/03 11:35:41 kid1| Making directories in /var/squid/cache/2E
2014/03/03 11:35:42 kid1| Making directories in /var/squid/cache/2F
2014/03/03 11:35:43 kid1| Making directories in /var/squid/cache/30
2014/03/03 11:35:43 kid1| Making directories in /var/squid/cache/31
2014/03/03 11:35:44 kid1| Making directories in /var/squid/cache/32
2014/03/03 11:35:44 kid1| Making directories in /var/squid/cache/33
2014/03/03 11:35:44 kid1| Making directories in /var/squid/cache/34
2014/03/03 11:35:45 kid1| Making directories in /var/squid/cache/35
2014/03/03 11:35:46 kid1| Making directories in /var/squid/cache/36
2014/03/03 11:35:46 kid1| Making directories in /var/squid/cache/37
2014/03/03 11:35:46 kid1| Making directories in /var/squid/cache/38
2014/03/03 11:35:48 kid1| Making directories in /var/squid/cache/39
2014/03/03 11:35:49 kid1| Making directories in /var/squid/cache/3A
2014/03/03 11:35:49 kid1| Making directories in /var/squid/cache/3B
2014/03/03 11:35:50 kid1| Making directories in /var/squid/cache/3C
2014/03/03 11:35:51 kid1| Making directories in /var/squid/cache/3D
2014/03/03 11:35:52 kid1| Making directories in /var/squid/cache/3E
2014/03/03 11:35:52 kid1| Making directories in /var/squid/cache/3F


Start squid:
Code:
# /usr/local/etc/rc.d/squid start
Starting squid.


This article is a proof of concept. Don't follow it unless you know what you're doing.
Jump to:  
News News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO