Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
copying running log files
Name: agha Date: July 22, 2005 at 04:33:33 Pacific OS: UNIX CPU/Ram: 512
Comment:
I have some logs files that are runing and never stops. After few days they becomes very huge. I want to move them to other place , and than make there contents to null such that there size becomes 0. Please help me in this regard.
Name: Dlonra Date: July 23, 2005 at 16:58:43 Pacific
Reply:
to accomplish this, the first requirement is that the processes which write into the logfiles either have to be off (terminated), or these processes close the log file after each write (unlikely).
is either of these this your case?
you will have to use cron() to implement this: man cron and google: cron tutorial
0
Response Number 2
Name: Luke Chi Date: August 9, 2005 at 17:39:18 Pacific
Reply:
# Save a copy of incoming entries to abc1_catch too tail -fn 0 abc1 | tee abc1_catch & # Make a copy of abc1 cp abc1 abc1_part
# empty abc1. So, abc1 file is always available. Almost at the same time stop copying the entries to abc1_catch > abc1;kill -9 `ps -ef|grep tail|grep -v grep|awk '{print $2}'
# append the abc1_catch and abc1_whole is the file you need to move to another server
Summary: Hi, I'm having problem writing to a log file. Appreciate if anyone can help. I'm running an application thru a script ("A") with input and output file as /opt/bin/appl $OUTPUT_FILE & from there I ca...
Summary: I am trying to find the email log file that would have info on users downloading their pop mail. Our email is hosted on a unix server running apache. I am not sure the exact version of mail software r...
Summary: Forgot to add, this should accept a file in another folder as input but to be sure, test it. If not, you'll want to run this from the directory the log file is located in and have the " grep "$2" "$1...