LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 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 systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
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 systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
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



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

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

All times are GMT -5. The time now is 09:29 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