Winscp : download updating log file to local

Advertisement

jitensetia
Joined:
Posts:
1
Location:
INDIA

Winscp : download updating log file to local

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.

Please help !

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Winscp : download updating log file to local

Are you asking how to continually download new contents from the remote log file?

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.

Reply with quote

Advertisement

You can post new topics in this forum