[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ProgSoc] Synchronise a file to a remote machine in real time



Roland Turner wrote:
foo@B $ ssh A tail -f logfile >logfile-copy

Too cool.

I was going to ask how this worked, but then I realised that here lies an opportunity to have a look at the source for tail.

At the risk of pinching Jay's thread, could someone explain how I can get the source for tail on my Debian unstable machine..? Presumably I can use apt-get source, but I'd like advice which extends to recommendations of which local directory I do the checkout to, alternatives which might include getting source from a cvs repo somewhere (rather than apt-get source, which I imagine just grabs the snapshot used to do the build (although I doubt tail changes much..)), and particularly where I'd expect to find the source for tail..?

In trying to decipher the above command-line, I haven't been able to infer if the tail process runs on B or A. I'm guessing A, and presumably the ssh server on B dumps its stdout to the stream which gets encrypted and sent back to B?

What are the implications of file-locking in the above scenario? Does machine B have a write-lock on logfile-copy, or does it open and close the file (thus making it periodically available for reading) while it is waiting for more data? Does tail buffer data if it can't get a write lock on a file while another process is reading it?


















- You are subscribed to the progsoc mailing list. To unsubscribe, send a message containing "unsubscribe" to progsoc-request@xxxxxxxxxxxxxxxxxxx If you are having trouble, ask owner-progsoc@xxxxxxxxxxxxxxxxxx for help.