0
votes
3answers
66 views

Tail a file from ssh and mirror to a local file

To tail a file over ssh, I can use ssh -t remotebox "tail -f /var/log/remote.log" However, it is possible to sync the tail with a local file? So a file automatically mirror the update of the tail ...
0
votes
3answers
42 views

tail -f AND allow text input

I want to create a script that allows some interactivity by tail -f logfile from myService allows text to be entered and sent to myService What I could not solve yet is this two functions working ...
0
votes
2answers
168 views

Capture piped multiline grep output into a variable

I'm using Zabbix's zabbix_sender.sh script to push exception stack traces to my remote Zabbix monitoring server. zabbix_sender.sh requires a key and a value for any data that it sends. It can read ...
15
votes
2answers
584 views

Bash Prompt Below Output - Background Log Tail

I used to work for a company who had a customised shell for management of one of their products that was running on Linux and I'm looking to replicate a key feature of this shell. All the work was ...
0
votes
3answers
271 views

tail-pipe-awk script, fine on Centos but weird on Ubuntu

I wrote a script on CentOS and now I'm trying to run it on Ubuntu and it is behaving unexpectedly. Here's something like the script, which I run under bash: sudo tail -F ...
1
vote
2answers
111 views

Grabbing the directory path in a message like “You have new mail in /var/spool/mail/root”

So I often get messages such as You have new mail in /var/spool/mail/root and end up typing/copy-pasting out: tail /var/spool/mail/root, which is a bit cumbersome. Is there a simple command that ...
0
votes
2answers
208 views

How to combine a real-time clock with tail -F

I always run tail -F to keep an eye on a log in a terminal window. The log has a UTC date at the beginning of each entry: [08-Jan-2013 16:24:22] Yo! When I glance at my log window I need to know ...
2
votes
2answers
573 views

Countinuous processing of tail -f output [closed]

I have a file where numbers are continuously appended: 1 2 3 4 I want to calculate their mean, also continuously, i.e.: 1 1.5 2 2,5 I don't want to check file periodically, I want to it in the ...
1
vote
3answers
1k views

tail -f and then exit on matching string

I am trying to configure a startup script which will startup tomcat, monitor the catalina.out for the string "Server startup", and then run another process. I have been trying various combinations of ...
2
votes
2answers
259 views

Bash edit file and keep last 500 lines

I am looking to create a cron job that opens a directory loops through all the logs i have created and deletes all lines but keep the last 500 for example. I was thinking of something along the lines ...