Questions tagged [tail]

Output the last part of files.

Output the last part of files, print the last part (10 lines by default) of each FILE; tail reads from standard input if no files are given or when given a FILE of `-'.

Manpage

96 questions
0
votes
1 answer

Pass output from the tail to the background script while still displaying data

I have a server and a local PC. When the local PC boots up, I run the following script to display the output from the server logs locally on the PC. /usr/bin/ssh -p '444' 'user@remoteserver' "tail -f /log/short.log" So far everything works great,…
0x29a
  • 135
  • 5
0
votes
0 answers

Use `tail` to rotate nginx logs in order have a single log file capped in size

Can use tail to rotate a nginx log file in orderer to have a single log file capped in size? tail -c 1000000 access.log > temp.log mv temp.log access.log kill -USR1 `cat /var/run/nginx.pid` The above would be executed in a cron job (running every 5…
Paolo
  • 149
  • 6
0
votes
1 answer

Is there a way to monitor file access

I need a way to monitor the moment a file is accessed. Something similar to Tail (but for windows). The file that is being accessed is not a text file but a binary (*.wav) file. While it would help if some C# code were available, a command line app…
Eminem
  • 103
  • 2
0
votes
1 answer

Continuously save tail of standard input

I have a program that generates large logs on the standard output. Actually I don't care about the log, but I do want to know the last 1000 lines or so if the program finishes or crashes. I want something in-between "tail -f" and "> log".. that is…
0
votes
2 answers

Tail grep what tools are for it

I would like to run the following command: tail -f /var/log/syslog | grep -ri 00:16:CB:1E:AF:CA In Linux but it does not working. How would you interactively grep certain text from log files?
naturelle
  • 1
  • 1
0
votes
1 answer

unknown client in my error.log

I have recently reinstalled my VPS OS and at present do not have any websites in my public_folder. In order to investigate a dovecot error which of course is not my question here, I issued tail -n 20 domains/mydomain.com.error.log which…
developer
  • 555
  • 2
  • 8
  • 16
0
votes
3 answers

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 parallel in one terminal. I would also like to…
0
votes
0 answers

Automatically reconnect ssh session for tailing remote file

I need a solution that basically tails a log file from a remote box... Works on Mac Restores itself whenever I have internet. (I frequently close and open the lid of my macbook) It could be a script that I keep running in terminal... I just need…
blak3r
  • 731
  • 1
  • 11
  • 16
0
votes
2 answers

How to TAIL & EGREP for a specified time range in a BASH script

The subject mostly says it all. I am in charge of a few web servers running Ubuntu 12.04 running Apache2 & I would like to setup APC. Now I understand APC can hit segmentation fault issues when acting on PHP code that has errors or quirks. So…
0
votes
2 answers

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 how old the entries are. I would prefer not to have…
Andy
  • 101
  • 3
0
votes
3 answers

tool to analyse/grep log files

Is there any web based GUIs to analyse or in realtime filter/grep log files from apache? log files that are access logs or error logs or postfix logs etc. Edit: I don't mean traffic analysis. Much more about greping error logs to locate some error…
thevikas
  • 153
  • 1
  • 8
0
votes
3 answers

how to "batch" output of "tail -F" or output all data in a stream every X seconds?

I am trying to monitor a log file in real-time. Say I issue a command such as: tail -F mysystem.log|grep -i error|mail ... This is supposed to monitor my log file, every time it sees an error, email the line containing the error. However, it is…
user23398
  • 1,191
  • 3
  • 9
  • 14
0
votes
1 answer

Seeking past end of file causes Apache hang, and it never restarts

I've actually solved my problem with a better script, but I'm still left wondering why Apache2 hung completely - this is an out-of-the-box ISPCONFIG 3.03 install, everything bang up to date, running perfectly. Until... The troublesome but…
talkingnews
  • 67
  • 1
  • 8
0
votes
0 answers

Stream output split between tail and underlying file

I was tailing a log file overnight, which is written to by a docker container that mounts a file under /var/log on the host. What I found this morning is log lines are randomly in only either tail's console output or the underlying file it was meant…
whoasked
  • 269
  • 5
  • 12
0
votes
1 answer

Why tail to same file create a empty file, or empty the file?

I try to maintain the last lines of a file, but when tail -n 10 test.txt > test.txt create or empty the file... SO: Ubuntu server Example: #test.txt file 20 May 23 12:24 test.txt a a a a a a a a a a use tail -n 10 test.txt > test.txt new…
DarckBlezzer
  • 183
  • 1
  • 1
  • 7