Results 1 to 6 of 6
Hi Geeks,
I would like to get some idea on "how to read remote servers log files starting from the last EOF".
This, the best way possible because the file ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-10-2013 #1Just Joined!
- Join Date
- May 2012
- Posts
- 4
remotely read file from last EOF
Hi Geeks,

I would like to get some idea on "how to read remote servers log files starting from the last EOF".
This, the best way possible because the file can be really big (couple of GB).
So recording the last line treated and re-scan the whole file may not be enough efficient.
The language of choice is Bash or Perl scripting.
Please let me know your thoughts.
Thanks a lot.
Fred.
- 01-10-2013 #2Just Joined!
- Join Date
- Jan 2013
- Location
- Russia, Nizhny Archyz
- Posts
- 14
I don't think bash will help you.
In C I would do simple: save last seekpos to other file.
For example [ http: //code.google .com/p/small-util/source/browse/parsesquid.c]here I used a file with marks (time / seek position) to make squid logs parcing more quickly.
In your case it's quite simpler: you need to save only one seek mark.
- 01-10-2013 #3Just Joined!
- Join Date
- May 2012
- Posts
- 4
- 01-10-2013 #4Just Joined!
- Join Date
- Jan 2013
- Location
- Russia, Nizhny Archyz
- Posts
- 14
You can use FUSE-sshfs to mount remote filesystem or directly run you scripts there.
If you have access to files only by http, use wget or curl (they allow to continue uploading).
- 01-11-2013 #5
You could definitly log into the remote server via ssh, reverse the file (tail -r) and scp the result to your local computer and while it downloads and grows in size you can examine it with tail.
- 01-15-2013 #6
I have logs similar to that and when I need to read them I use the tail function.
This will display that last 1000 lines of that log. You could also direct it to a tmp file.Code:tail -1000 <filename> | more


Reply With Quote

