LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-09-2011, 12:37 PM   #1
amjadask
LQ Newbie
 
Registered: Jan 2011
Posts: 25

Rep: Reputation: 0
Redirecting one output to another file


hi
i have installed squid proxy server in rhel
and am continuously monitoring the log messages in /var/log/squid/access.logs in that i search only TCP_DENIED through grep command
i want to redirect or copy that TCP_DENIED messages to a file can u help me out how should i copy or redirect denid messages in a file


if there is any possibilities to redirect messages by date by date please tell me the solution
i need it urgently please help me out
 
Old 02-09-2011, 12:40 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux, LFS, Slitaz
Posts: 3,057
Blog Entries: 1

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
Something like this?

Code:
grep TCP_DENIED /var/log/squid/access.logs >> /tmp/output.txt
 
1 members found this post helpful.
Old 02-10-2011, 01:18 AM   #3
amjadask
LQ Newbie
 
Registered: Jan 2011
Posts: 25

Original Poster
Rep: Reputation: 0
thanqs alot i got the solution i have one more query can i run cronjobs for particular time like 14:00-16:00 hrs
i want to copy denied messages, is it possibl,e give me the solution
thanks&regards
 
Old 02-14-2011, 11:21 AM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux, LFS, Slitaz
Posts: 3,057
Blog Entries: 1

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
Quote:
Originally Posted by amjadask View Post
thanqs alot i got the solution i have one more query can i run cronjobs for particular time like 14:00-16:00 hrs
i want to copy denied messages, is it possibl,e give me the solution
thanks&regards

To run the command every 15 minutes (*/15) and between the hours of 2 and 4 (14-16) you can add this to your crontab by running "crontab -e"

Code:
*/15 14-16 * * * grep TCP_DENIED /var/log/squid/access.logs >> /tmp/output.txt
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
redirecting make output to file babu198649 Linux - Newbie 20 09-02-2010 03:30 AM
Redirecting output to a compressed file rrosnowski Linux - Software 3 06-13-2007 07:51 AM
Redirecting socket output to a file elmafiacs Programming 1 10-15-2005 05:18 AM
Redirecting colsole output to file. danimallv Linux - General 4 07-05-2005 02:44 PM
redirecting output of compile to a file halfcan Linux - Hardware 1 02-05-2005 10:01 PM


All times are GMT -5. The time now is 01:08 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration