LoginSignup
2
2

More than 5 years have passed since last update.

winscpのスクリプトを使って自動でサーバにソースをコピーする

Posted at

よく使うので

動かすバッチファイル
以下を変換する
{script path} : スクリプトファイル配置場所

sync.bat
CALL :TEST_SERVER

:END
exit 0

:TEST_SERVER
start winscp /sript={script file}
exit /b

winscpのスクリプトファイル
設定ファイル(config.txt)は環境によって異なると仮定して排除
ソース管理はgitで行っていると仮定して排除
以下を変換する
{serverip} : 配置先IPアドレス
{local src path} : ローカル上のパス
{remote src path} : 配置先のパス

winscp_sync.txt
option batch abort
option confirm off

open scp://user:password@{serverip}
synchronize -filemask="| config.txt; .git/" remote {local src path} {remote src path} -delete -nopermissions
keepuptodate -filemask="| config.txt; .git/" {local src path} {remote src path} -delete
exit

参考
winscp コマンドリファレンス

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2