LinuxサーバのファイルをWindowsにバックアップする場合、WinSCPをバッチモードで実行するのが手っ取り早い。WinSCP用のスクリプトファイルとWindowsのバッチファイルの2種類用意すれば良い。
WinSCP用のスクリプトファイル(rsync-ubuntu-14.04-server-amd64.txt)
option batch abort option confirm off #サーバに接続 open scp://ubuntu:ubuntu@192.168.233.101 #WinSCPのsynchronizeコマンドを発行 #下記はサーバーのhomeディレクトリをWindowsにコピーする場合の例 synchronize local -delete C:\xxx\home /home/ubuntu exit
上記のスクリプトを実行するためのWindowsバッチファイル
C:\winscp572\WinSCP.com /script=rsync-ubuntu-14.04-server-amd64.txt pause
※WinSCPのコマンドリファレンス
http://sourceforge.jp/projects/winscp/wiki/script_commands