What is the best way to keeps rsynced copy of rotate log files ? x.log -> x.log.1 -> x.log.2.gz -> ... Can rsync "notice" changes of file name and avoid needless synchronization ? -- Andrzej [en:Andrew] Adam Filip anfi@priv.onet.pl anfi@xl.wp.pl http://anfi.webhop.net http://slashdot.org/~anfi
On Wed, Feb 25, 2004 at 11:14:47PM +0100, Andrzej Filip wrote:> What is the best way to keeps rsynced copy of rotate log files ? > > x.log -> x.log.1 -> x.log.2.gz -> ... > > Can rsync "notice" changes of file name and avoid needless synchronization ?Change how you rotate log files so that once rotated the old files don't change names. x.log -> x.log.yyyymmdd.gz If you are using logrotate there is a patch at SuSE for it to do this and Red Hat (owner of logrotate) has an open enhancement request to add the feature. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=108775 -- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: jw@pegasys.ws Remember Cernan and Schmitt
On Wed, Feb 25, 2004 at 11:14:47PM +0100, Andrzej Filip wrote:> What is the best way to keeps rsynced copy of rotate log files ? > > x.log -> x.log.1 -> x.log.2.gz -> ... > > Can rsync "notice" changes of file name and avoid needless synchronization ?One thing you can do is to run the same log-rotate on both machines at the same time (yes, on the backup machine too). Just be sure no rsync run overlaps with the log-rotating time period, and it will give the next rsync synchronization a significant head start. ..wayne..