LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-24-2012, 03:23 AM   #1
abdeali
LQ Newbie
 
Registered: Dec 2008
Distribution: RedHat/Fedora
Posts: 2

Rep: Reputation: 0
Question Renaming/Overwriting File in Squid Folder to Block and Unblock the Sites.


Hi All,

I am looking for a script:
Scenario:
There is a file in Squid folder to Block access to particular sites, and there is another folder created in Squid Folder which contains the Access.acl and Blocked.acl list of blocked sites like Facebook,Orkut,etc.
Now What I'm looking for is, I want a Script, so that on Particular day Access.acl file should move to Squid folder and should get renamed as Blocked.acl in Squid folder overwriting the Original file i.,e. blocked.acl or should get renamed to xxx.acl in squid folder and vice-verse after particular time.

Will create the CronJob to run the script, only looking for the script.

Thanks in advance!

Regards,
^_^LI.

Last edited by abdeali; 05-24-2012 at 03:35 AM.
 
Old 05-25-2012, 04:03 AM   #2
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 509

Rep: Reputation: 203Reputation: 203Reputation: 203
Hi there,

I'm not sure I understand the details of which files you want to move, and when. I'd suggest you keep a master copy of all the files in your subfolder, and copy them to the squid folder rather than rename them, though. For example, if you have an "office hours" version and an "after hours" version of the files, call them blocked.acl.day and blocked.acl.night, and then simply copy it to blocked.acl in your squid folder when required. This way your script doesn't need to try and remember which file was last moved, and it is a simple two liner: one "cp" command to copy, and a reload of squid for the change to take effect.

If what you are trying to achieve is different rules for different times of the day, it might be easier to write your ACLs accordingly, though. See http://wiki.squid-cache.org/SquidFaq...cific_times.3F for an example of this.

Regards,

Clifford
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Squid to block all the sites except 1 or 2 sites winxandlinx Linux - Networking 8 10-27-2010 02:53 AM
Squid: I like block different users different sites iseymur Linux - Security 1 02-06-2010 11:36 PM
squid 2.6 not blocking sites even i entered ACL to block sites mohantorvalds Linux - Server 1 01-08-2009 04:17 AM
Squid block sites linuxnirmal Linux - Security 5 11-15-2006 10:59 AM
how to block sites with squid.conf boakiba Linux - Networking 1 08-11-2003 05:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration