のようなものを使う方法はありますかwinscp
?
Windowsでいくつかのコマンドを実行して、UNIXからWindowsにファイルをコピーする必要があります。私はこれを行うことができるツールを検索して見つけました。
ftp
sftp
scp
pscp
winscp console.
編集する:私のサーバーでその機能が有効になっていないpscp
ことを確認しましたが、使用できるものはありますか?ftp
UnixファイルをコピーするためにWindowsでスクリプト/コマンドを実行するために必要な方法を提案してください。
編集2winscp
:コンソールからこのエラーを受け取るsftp
:
winscp> get abc.sh c:\
abc.sh | 0 KiB | 0.0 KiB/s | binary | 0%
Can't create file 'c:\abc.sh'.
System Error. Code: 2.
The system cannot find the file specified
(A)bort, (R)etry, (S)kip, Ski(p) all:
ベストアンサー1
私はWinSCP
これにスクリプトを使用しますこここれを行う方法に関する良いドキュメントがあります。スクリプト例:
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect using a password
# open sftp://user:[email protected] -hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Connect
open sftp://[email protected] -hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Change remote directory
cd /home/user
# Force binary mode transfer
option transfer binary
# Download file to the local directory d:\
get examplefile.txt d:\
# Disconnect
close
# Connect as a different user
open [email protected]
# Change the remote directory
cd /home/user2
# Upload the file to current working directory
put d:\examplefile.txt
# Disconnect
close
# Exit WinSCP
exit
次に保存し、example.txt
次のコマンドを使用します。
winscp.exe /console /script=example.txt