Linux : How to Clear Squid Cache

When you want clear cache automatic. you can make like these :-

– Use putty and type command

# fcrontab -u root -e

After run fcrontab, you can see script and go to below of file

Command for fcrontab syntax

[ min hrs day-of-month month day-of-week command ]

If a day of month and a day of week are given, the command will execute only when both match with the current time and date unless option dayor is set. For example, with the line

5 10 31 * 7 echo ”

echo will only be executed days which are a Sunday AND a 31th, at 10:05.

minute : 0-59
hour : 0-23
day-of-month : 0-31
month-of-year: 1-12
day-of-week : 1-7

(1=Mon, 2=Tue, 3=Wed, 4=Thu, 5=Fri, 6=Sat , 7=Sun)

– Copy 5 lines within bracket

################################
10 09 * * 2 rm -R /var/log/cache
12 09 * * 2 mkdir /var/log/cache
13 09 * * 2 chmod 750 /var/log/cache
14 09 * * 2 chown squid.squid /var/log/cache
15 09 * * 2 /usr/local/bin/restartsquid
################################

What is meaning for this script , Every tuesday time 9:10 , system will clear cache

Number 10 as minute ,09 as hour , 2 as Tuesday

ที่มา : http://cybertiptrick.blogspot.com/2010/04/linux-clear-squid-cache.html

Categories: ข่าวประชาสัมพันธ์, เขียนโปรแกรม | ใส่ความเห็น

เมนูนำทาง เรื่อง

แสดงความเห็นเกี่ยวกับเรื่องนี้

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / เปลี่ยนแปลง )

Twitter picture

You are commenting using your Twitter account. Log Out / เปลี่ยนแปลง )

Facebook photo

You are commenting using your Facebook account. Log Out / เปลี่ยนแปลง )

Google+ photo

You are commenting using your Google+ account. Log Out / เปลี่ยนแปลง )

Connecting to %s

บลอกที่ WordPress.com .

%d bloggers like this: