New Bee for Unix -- Help me
i am new bee for unix, i have query
1. i have a log file which keeps appending
Q - i want to capture day to day exceptions along with time from that log file and send to another file, also i want only specific exceptions (not all)
A -- i am using tail -f "logfile" | grep exception "logfile" >> "path to save the file"
Pls guide me...
Re: New Bee for Unix -- Help me
You are using tail -f to get the logfile content.-f will always wait for data to append on the file.
You can not simultaneously execute tail -f and append the result to a file.
Because the contents will not permanently append to the error file.since it is waiting for the tail command's execution to finish.So you can not append it using '-f'.
tail logfile | grep "exception" logfile >> error_log