PuTTY Secure File Transfer (SFTP) client
Release 0.59
Usage: psftp [options] [user@]host
Options:
-V print version information and exit
-pgpfp print PGP key fingerprints and exit
-b file use specified batchfile
-bc output batchfile commands
-be don't stop batchfile processing if errors
-v show verbose messages
-load sessname Load settings from saved session
-l user connect with specified username
-P port connect to specified port
-pw passw login with specified password
-1 -2 force use of particular SSH protocol version
-4 -6 force use of IPv4 or IPv6
-C enable compression
-i key private key file for authentication
-noagent disable use of Pageant
-agent enable use of Pageant
-batch disable all interactive prompts
# 写psftp需要的脚本文件sftp.txt
for /f %%i in ('realdate.com /d') do (set remotelogname=%%i)
echo cd /logs > sftp.txt
echo get dump%remotelogname%.log >> sftp.txt
echo bye >> sftp.txt
# 写日志文件sftp.log
echo --------------------------------------- >> sftp.log
for /f %%i in ('realdate.com /f=\"CCYY-MM-DD\"') do (set locallogdate=%%i)
for /f %%i in ('realdate.com /f=\"hh:mm:ss\"') do (set locallogtime=%%i)
echo %locallogdate% %locallogtime% >> sftp.log
psftp remotehost -l username -pw password < sftp.txt > sftp.log
echo. >> sftp.log
echo done. >> sftp.log