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

FAQ
It is currently Wed Aug 23, 2017 8:48 am


System administration, processes administration, jobs, cron, resources, limits, shells, ssh, telnet.

Author Message
mandrei99
Post  Post subject: Squid clear cache on FreeBSD  |  Posted: Mon Mar 03, 2014 7:37 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 245

Offline
 

Squid clear cache on FreeBSD

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.





Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "Squid clear cache on FreeBSD"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. How to clear and initialize squid cache

mandrei99

0

1675

Thu Jan 08, 2015 5:29 am

mandrei99 View the latest post

There are no new unread posts for this topic. Linux clear screen / terminal

mandrei99

2

4584

Wed Mar 04, 2015 8:52 am

Guest View the latest post

There are no new unread posts for this topic. How to get UFS filesystem block size in FreeBSD

mandrei99

0

2035

Mon Jul 22, 2013 9:49 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to list PCI devices in FreeBSD - pciconf

mandrei99

0

7293

Mon Jul 22, 2013 9:58 am

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD - fuser checking processes that are using a filesystem

mandrei99

2

1188

Tue Mar 24, 2015 1:26 am

Woolmer View the latest post

There are no new unread posts for this topic. How to read UFS filesystem super block information in FreeBSD

mandrei99

0

1386

Mon Jul 22, 2013 9:52 am

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD slow booting: Recovering vi editor sessions

mandrei99

0

1262

Wed Feb 19, 2014 4:02 pm

mandrei99 View the latest post

There are no new unread posts for this topic. How to list the largest files in a directory in Linux/FreeBSD

mandrei99

0

540

Thu Jan 22, 2015 5:14 pm

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD - How to retrieve the newfs command that was used to create an existing UFS filesystem

mandrei99

0

683

Mon Jul 22, 2013 9:55 am

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD - list disks drive in the system with atacontrol and camcontrol

mandrei99

0

6987

Tue Jan 20, 2015 3:08 am

mandrei99 View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
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