Tuesday, December 4, 2012

tailing logs over SSH

See the blogpost from Karl Lockhart on tailing a log file over SSH:

"Tailing logs is a very good way to keep an eye on the operation of processes running on your server. Sometimes you want a little more flexibility than the simple SSH window affords, or you simply want to view logs via locally available software. I accomplish this with a very simple solution as I need to run windows on my development machine. I use plink.exe available from the putty download website, as well as BareTail, don’t google that, available from Bare Metal Software. Plink will allow you to open a noninteractive connection to the server and store the output in a local file. The following command works under Windows, “C:\Path to\PuTTY\plink.exe” user@hostname tail -1000f /path/to/logfile.txt > C:/path/to/logfile.log“. This will create the logfile specified after the redirection operator and populate it with the output of your tail from the remote machine. Simply open the file with BareTail to take advantage of a local tail and all the features of BareTail. This is actually very simple, but works very well. You can run any command after the user@hostname part of the command. This does assume that you have public/private keys set up."

1 comment:

  1. Hi
    You can checkout dbitail:

    https://github.com/pschweitz/DBITail/wiki

    And for download:
    https://github.com/pschweitz/DBITail/releases

    ReplyDelete