Posted By

nikefido on 09/24/11


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Priestd09


Shell script to check log files in real time via ssh


 / Published in: Bash
 

Check in real time changes to a log file. In this case, the file is created by date, one new one per day (a CodeIgniter log file), so some extra items were added to find the log file

  1. #!/bin/bash
  2.  
  3. remoteuser=user_name
  4. remotecomputer=some_ip_address
  5. ssh -l "$remoteuser" "$remotecomputer" "tail -f path/to/log/files/log-`date +"%Y-%m-%d"`.php"

Report this snippet  

You need to login to post a comment.