Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to connect to the linux machine with WinSCP(command line) from Windows. and I want to get logs.

There are logs in linux machine


winscp sftp://account:pass@machine:22 How to get logs efficiently?

share|improve this question

If you're using scripting I think it's time for you to read the WinSCP documentation. Last time I looked it contained examples that show exactly how to do what you want.

Of course if you're using the GUI just drag them over to your Windows folders within the WinSCP interface.

share|improve this answer
Thank you so much!!!!. I have to read the documentation – freddiefujiwra Jun 30 '09 at 12:30
It's always a good starting point. ;) – John Gardeniers Jun 30 '09 at 12:51

I have a similar solution using winscp scripting, mine looks like this:

winscp Script:

option batch continue
option confirm off
open logs:*******@10.x.x.x
synchronize remote "c:\daily_logs\*" ./81/
synchronize remote "c:\daily_logs\" ./81/

I use iCronService, which works on every version of windows I have tried it on, including x64 based ones, and this is what my crontab looks like:


00 22 * * * cmd /c "winscp /console /script=c:\bin\scplogs /log=LOG_OF_SCP.LOG"

One could also compress the logs first to save some time, bandwidth, and space. Surely this is not the most elegant solution because the password is hardcoded into the scp script, but could be replaced with keys if you like.

share|improve this answer

You can also use psftp.exe to do the job with a command line like this one:

psftp.exe username@server -be -pw user_password -b c:\script.txt"  
Script.txt may contain for example:
lcd c:\my_backup
get /var/log/application/*
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.