use Net::SFTP::Foreign; use Fcntl qw(SEEK_END); my $host = ...; my $file = ...; my $sftp = Net::SFTP::Foreign->new($host); $sftp->error and die "Unable to connect to remote host: ".$sftp->error +."\n"; my $fh = $sftp->open($file) or die "Unable to open file $file: ".$sftp->error."\n"; # go to end of file seek($fh, 0, SEEK_END); my $sleep = 1; while (1) { while (<$fh>) { print; $sleep = 1; } sleep $sleep; $sleep++ unless $sleep > 5; }
In reply to Re: How to tail file on remote host
by salva
in thread How to tail file on remote host
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |