I have a solaris box and a windows server. The windows server runs cygwin for ssh service. I have an audit log in solaris box. When ever new records are added to the log file, this delta has to be trasported to a remote file in windows. I can do a ssh once in a while, but want the transfer to be real time. tail -f gets me this kind of output. But I don't know how to scp or sftp this output to a remote file. I am looking for a script that can do this.
I have set up a password less authentication between these two servers using public keys.
It worked thanks. But when the file is rotated (The file gets deleted/renamed when it exceeds a certain size and another file with the same name gets created), the functionality is broken. It is no longer watching the new file. Is there any way of watching the new file, with out running the script again? Thanks.
Thanks. Problem solved at the source. tail -F works even when the file is rotated. However same problem at the destination. If I delete the file, the data no longer gets written. I wasn't even able truncate the file (although I have write permission, I was not able to write to it, when the script is running). Suggestions please. Thanks