Jika anda ingin menghapus sebuah object pada cache squid proxy server,
yang dapat anda lakukan adalah dengan cara manual dan otomatis
menghapus cache squid proxy tersebut, berikut kita akan membahas cara
dalam memaintenance mesin proxy kita, cara berikut dapat di jalankan
manual atau otomatis dalam menghapus cache squid proxy anda.
Menghapus cache squid proxy secara manual
1. Hentikan/stop proses squid yang sedang berjalan
# /etc/init.d/squid stop |
# rm -rf /cache/* |
# squid -z |
# /etc/init.d/squid start |
Menghapus cache squid proxy secara otomatis
Jika anda ingin menghapus cache squid proxy secara otomatis berikut langkahnya :
1. Buat sebuat script yang akan digunakan untuk memeriksa dan menghapus cache squid proxy secara otomatis
# touch /root/clear-cache-squid.sh# vim /root/clear-cache-squid.sh |
Masukkan kode berikut, dimana dalam kode berikut pengaturan Hardisk squid proxy sebesar 80GB, direktory cache squid berada pada /cache dan script akan diletakkan pada /root
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
| #!/bin/bash#!/bin/bash# direktori cache proxyCACHEDIR=/cache# kapasitas direktori cache proxy (80GB)CACHEDIRSIZE=85899345920ONEMB=1048576ONEGB=1073741824COUNTMB=`expr $CACHEDIRSIZE / $ONEMB`COUNTGB=`expr $CACHEDIRSIZE / $ONEGB`COUNTALOC=`expr $CACHEDIRSIZE / $ONEMB`# mendapatkan besaran direktori cache saat iniSIZE=`du -bc $CACHEDIR | grep total | awk '{print $1}'`SIZEM=`du -bch $CACHEDIR | grep total | awk '{print $1}'`# jika besaran direktori cache saat ini sama atau lebih besar dari # kapasitas direktori cache proxy maka hapus cache proxyif [ $SIZE -ge $CACHEDIRSIZE ]then/usr/bin/clearecho "=================================="echo "=== Generate Clear Cache Squid ==="echo "=================================="echo "Cahce Squid Proxy :" $CACHEDIRecho "Jumlah cache tersimpan :" $SIZE Byte / $SIZEMecho "Batas maximum cache :" $CACHEDIRSIZE Byte / $COUNTALOC MBecho " * Clear cache squid in proccess ..."sleep 10 /etc/init.d/squid stop # stop service squid rm -fdR $CACHEDIR/* # hapus cache proxy squid -z # membuat cache direktori /etc/init.d/squid start # start service squid/usr/bin/clearecho "===================================="echo "=== Clear Cache Squid Success !! ==="echo "=== http://hanpeace.blogspot.com ==="echo "===================================="else/usr/bin/clearecho "================================================"echo "=== Status Directory Cache Squid Proxy [OK] ==="echo "=== http://echo "================================================"echo "Cahce directory squid :" $SIZE Byte / $SIZEM echo "Alokasi cahce squid :" $CACHEDIRSIZE Byte / $COUNTMB MB / $COUNTGB GBfi |
# chmod ug+x /root/clear-cache-squid.sh |
Edit cronjob
# crontab -e |
0 0 * * * /root/clear-cache-squid.sh |

Menghapus Cache Squid Secara Manual/Otomatis >>>>> Download Now
ReplyDelete>>>>> Download Full
Menghapus Cache Squid Secara Manual/Otomatis >>>>> Download LINK
>>>>> Download Now
Menghapus Cache Squid Secara Manual/Otomatis >>>>> Download Full
>>>>> Download LINK