Redirect ErrorLog to a script


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Redirect ErrorLog to a script
# 1  
Old 01-22-2009
Question Redirect ErrorLog to a script

Hello, guys!

I need to redirect the error_log of apache web server to a script. I tried to use a pipe instead of a filename but this will cause me some troubles beacause cPanel doesn't like it. So, I would like to try something else.

Do you have any ideea on how can I read the content of the error_log file realtime? I can do a small daemon that will check from time to time the error_log file but this would be a waste of time. I need something that works realtime.

I guess that I should make error_log be a pipe to a script, but I'm not sure how to do this. Can someone give an ideea? Or do you have any ideeas on how could I read error_log realtime without having to change httpd.conf?
# 2  
Old 01-22-2009
tail -f ?
# 3  
Old 01-23-2009
I need the results to be processed by a script. I could use tail to get the last lines every few seconds but as error_log is pretty big this will take much time and will eat too much resources.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Redirect script output to file after grep

i have simple program that generate log file 1 line every sec, i need to do grep for specific record then redirect to another file. #!/bin/bash for i in `seq 1 20`; do echo $i sleep 1 done ./test.sh |egrep "5|10|15" 5 10 15 r ./test.sh... (2 Replies)
Discussion started by: before4
2 Replies

2. Shell Programming and Scripting

Script to call a menu script and redirect each option to a text file

Hello, I want to design a script that will call an existing menu script and select options one by one and redirict the out put to a file. For example;- In the script MENU.sh there are 10 options i want to design a script MENU2.sh that will select option 2 3 4 6 7 10 and redirict the output... (4 Replies)
Discussion started by: spradha
4 Replies

3. Shell Programming and Scripting

Need script to compare and redirect

Hi, I have a file, sol_servers_global, which is list of all solaris global servers in my environment and another file, solaris_non_global_zones_from_DB. I have a gateway server, from where all servers are contactable via ssh. I have collected name of zones running on these servers with below... (3 Replies)
Discussion started by: solaris_1977
3 Replies

4. Shell Programming and Scripting

PHP Redirect Script

Hello Unix.com, I badly need to get rid of drones that access my website. I'm using a hits php script that logs every ip that visits my index.php. Looks like this: <?php $IP = getenv("REMOTE_ADDR"); $day = date('l jS \of F Y h:i:s A'); $fout = fopen("hits.txt", "a"); fputs($fout,... (0 Replies)
Discussion started by: galford
0 Replies

5. AIX

Forwarding AIX syslog/errorlog to remote SQL DB

Due to a project I'm currently tasked with I'm spending my time trying to find a way to forward the syslog to a remote, in this case Red Hat, server and squeezing it into a SQL DB. Rsyslog is doing this job quite nicely for most of our test-servers, but I couldn't find any reliable information on... (1 Reply)
Discussion started by: Skleindl
1 Replies

6. UNIX for Dummies Questions & Answers

Crons -Last run time and errorlog

Hi There are few crons running under my account. How to check the last run time of the Cron and if it has run successfully without any errors. Also if there are any errors while running, will the errors be stored some where? How to check the status of all the Crons? Thanks Ashok (3 Replies)
Discussion started by: ashok.k
3 Replies

7. Shell Programming and Scripting

Cannot redirect to STDIN in a shell script

I am unable to use STDIn redirection with < (commands) When I do the following, both approaches work and give the same results: 1. $ printf "aaa\nbbb\n" > file1 $ printf "111\n222\n" > file2 $ cat file1 file2 aaa bbb 111 2222. $ cat <(printf "aaa\nbbb\n") <(printf "111\n222\n") aaa... (8 Replies)
Discussion started by: metaltree
8 Replies

8. Shell Programming and Scripting

Redirect bg process output to within the script

Hi, I have a process running in the background, which throws up some output to the terminal when I run my script. How can I read this output from my script? Thank you. (5 Replies)
Discussion started by: Theju
5 Replies

9. Shell Programming and Scripting

How redirect script output from inside of script?

Is it possible to redirect a script output by command inside of that script? I mean, if I have a script 'dosome.sh' I could run it by >dosome.sh > dosome.log I would dream to get some command inside of scrip to do the same; so, running the dosome.sh would have all output redirected to a log... (4 Replies)
Discussion started by: alex_5161
4 Replies

10. AIX

Porblem with errorlog

hi all, i am facing a problem that my error log was empty(0 byte). i dont whether threr is any mistake or my server working that much nicly...... please find some output down. # errpt 0315-180 logread: UNEXPECTED EOF 0315-171 Unable to process the error log file /var/adm/ras/errlog.... (1 Reply)
Discussion started by: rrlog
1 Replies
Login or Register to Ask a Question