Shell script to check log files in real time via ssh

/ Published in: Bash
Save to your folder(s)

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

Copy this code and paste it in your HTML
  1. #!/bin/bash
  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


RSS Icon Subscribe to comments

You need to login to post a comment.