type "crontab -e" on the command prompt...
A file will be opened. Place this line in that file
0 0 * * * cat file | awk '{if($7!="(localhost[127.0.0.1]):"){for(i=1;i<=NF;i++){printf $i" "}print""}}' > new_file
file is the path to the proftd.log and the new_file is where you
want it to be stored......
P.S :- This code will be executed at 00:00:00 time everday ....
<edit>
You shouldn't use same file as both "file" and "new_file' . If you want to store in the same log file then,
0 0 * * * cat file | awk '{if($7!="(localhost[127.0.0.1]):"){for(i=1;i<=NF;i++){printf $i" "}print""}}' ; cp new_file file ; rm -f new_file
You should give the full paths to file and new_file
Last edited by SaTaN; 09-24-2003 at 01:51 AM.
|