Hello, i am trying to find a way to copy only a difference from a log file.
I have .txt files in following format:
20140413 133812-log events AAAA......
20140413 133812-log events BBBB!
20140319 130545-log events CCCC!
I want to run the script and if there is a new lines which are logged after the last time i have checked the file i want to copy only them.
I am not sure how to proceed, should i try to count rows in the file, store the number in some file and then copy everything after that, and after that write the new rows number .. and so on.
I don't think this is a good approach ..
or somehow should i try to get the new lines by date and time..
Can someone give me an advice..