Timestamping each line of 'ping' output
Currently, my home internet connection is very unstable - it drops out every few minutes. Understandably very annoying. So I'm trying to use the ping command to find out when the internet connection fails. This method works fine for when I just want to detect that a failure's occurred, but I also want to be able to determine the time at which these failures occurred.
As such, I'm wondering if there's any way I can get the console to show a timestamp for each line of output from the ping command, and ideally if this output can also be written to a file at the same time it appears on the console. Many thanks in advance for any assistance rendered. - EG |
You could run a small script via cron, for example:
Code:
#!/bin/bash |
All times are GMT -5. The time now is 10:39 AM. |