Home Man
Today's Posts

BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Tail over rsync data

rsync, tail -f

👤 Login to reply

Thread Tools Search this Thread
# 1  
Old 08-13-2013
Tail over rsync data

I have written a shell script (that will be called in every 5 seconds) that used rsync to copy logs of our production server from server A(production) to server B (Dev), because we don't allow team members to hit server A.
The shell script is working fine.
But we are facing a problem that command "tail -f <log file name>" on server B is not printing current logs.
But if we continuously re-open it in vi editor we have noticed changes.
Please tell the way how to do that ?
# 2  
Old 08-13-2013
I guess that it gets a new file every 5 seconds, and tail -f only follow old file that no more exists.
Try this instead:
tail --follow=name /var/log/yourlogfile

This make tail follow the name of the file, and have no problem when file is overwritten etc
# 3  
Old 08-13-2013
Hi Jotne,
Thanks for the quick reply. I have used the command, but it is reading and display all contents of the given file. I only need the difference (delta) of the two files.
👤 Login to reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Rsync Error: rsync: link_stat failed: No such file or directory (2) mohtashims Shell Programming and Scripting 2 02-06-2018 09:21 AM
Tail + tricampeon81 Shell Programming and Scripting 2 06-21-2016 04:26 PM
Extracting data from rsync log treds Shell Programming and Scripting 3 06-05-2015 06:44 AM
Joining multiple files tail on tail kayak Shell Programming and Scripting 2 10-02-2012 05:36 AM
Extract data based on match against one column data from a long list data patrick87 Shell Programming and Scripting 12 11-17-2009 03:27 AM
rsync data corruption thameema UNIX for Advanced & Expert Users 1 05-19-2009 08:23 AM
tail -f wannalearn Shell Programming and Scripting 4 04-10-2007 05:22 PM
Tail?? qfwfq Shell Programming and Scripting 7 06-19-2006 01:15 AM
how to sed with tail redlotus72 UNIX for Dummies Questions & Answers 1 08-30-2005 05:27 AM
using tail -f cdunavent Shell Programming and Scripting 6 10-23-2002 05:10 PM

All times are GMT -4. The time now is 02:15 AM.

All times are GMT -4. The time now is 02:15 AM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
Show Password