jitensetia
Joined:
Posts:
1
Location:
INDIA

Can anyone help me with this ?

I have a log (text) file on remote server which is continously updating when users access the website. I need to download this file in realtime to local drive. Can this be achieved to download this file with realtime writing logs.

martin
Joined:
Posts:
31,405
Location:
Prague, Czechia

Use get -resume in WinSCP script:
https://winscp.net/eng/docs/scriptcommand_get#resume
open sftp://username:password@example.com/
get -resume /remote/path/my.log C:\local\path\my.log
exit
And loop the script continuously. E.g. from a batch file using goto command.
:loop
winscp.com /script=get.txt /log=c:\path\to\winscp.log
goto loop
Though that will require new connection for each update.
You may want to use WinSCP .NET assembly instead, to run the loop over one connection.

You can post new topics in this forum