Search code examples
loggingsshraspberry-pifile-transfer

What would be the most efficient way to log a raspberry pi's data over ssh?


I currently have a python script on a raspberry pi that creates a log file in the same directory while running, with important data that I would like to view in real time on my laptop (that I can ssh into the pi with).

Obviously I can view the log file on my laptop while ssh'd using a text editor, but it's not a real-time data stream.

Unfortunately while I have a decent amount of python experience, I don't know much about networking stuff, except that I could scp/rsync the file onto my computer but of course, that's not giving me a real time view of my log file either.


Solution

  • tail is commonly used for this, tail -f yourlogfile.log will show the ten latest lines of the file and update on file change.