Logfile::Rotate may help if I run it in an hour interval
But, I am really curious about that what will happen if the Logfile::Rotate rotate the log file while the rsync server is also updating the log file? Will be there some log lost? | [reply] |
It depends. You haven't provided enough information.
I assume the logfile rotation would be happening on the system being rsync'd FROM.
You'll have to check how rsync does its directory comparison, but I think it does it once at the start of the sync. So if the rotation happens after that point, but before the copies are complete, then your latest log slice might be missed by the rsync.
But it's not "lost" -- it's just not rsync'd.
All you have to do is set up the Rotate's to happen every n minutes (60, 120, whatever...), and rsync in the middle of those intervals. In that case, unless you've accumulated more data in n/2 minutes than rsync can move, rsync isn't going to conflict with the rotation...
| [reply] |
I want to rotate the rsynd server's log file.
When some rsync client boxes rsync its local dir to the rsynd server, rsynd server will log what files it received from the clientbox. And I want to analyze the rsyncd server's log file in an hour interval, then extract what files it received from the client boxes and do some process on these files.
So I want to rotate rsyncd server's log file by hourly, but I am afraid that I maybe rotate the server log file while the server is also updating the log file, when these two actions happen to the same log file at the same time, will be there something bad happen, like some logs will be lost?
| [reply] |