colorful

zc qq:1337220912

 

Winscp脚本同步文件

# winscp.exe /console /script=sample.txt
# Automatically answer all prompts negatively not to stall
# the script on errors
# option echo  on|off
option echo off
# option batch on|off|abort|continue
option batch on
# option confirm  on|off
option confirm off
# option transfer  binary|ascii|automatic
# option synchdelete  on|off
# option exclude clear | <mask>[;<mask2>...]
# option include clear | <mask>[;<mask2>...]
# open [ sftp|ftp|scp:// ][ <user> [ :password ] @ ] <host> [ :<port> ]
# open user:password@example.com
# Connect  
open  USER:PASS@IP:PORT
# Change remote directory
# cd /home/user              #远程工作目录
cd REMOTE PATH
# Change local directory
# set to Self's working dir 
lcd LOCAL PATH                   #本地工作目录
# Force binary mode transfer
option transfer binary
# Download file to the local directory d:\
# get examplefile.txt d:\
# option synchdelete  on|off
option synchdelete off       #是否同步删除  
# option include clear | <mask>[;<mask2>...]
# option include /2008-*-*/;/2009-*-*/;/2010-*-*/;/2011-*-*/;/2012-*-*/;/2013-*-*/
# synchronize local|remote|both [ <local directory> [ <remote directory> ] ] 
# 传输方式:Local为远程至本地,remote为本地到远程,both双向传输
synchronize local  
# Disconnect
close
# Exit WinSCP
exit


======================================================
#清除上面的注释和个人理解了一下
option echo off
option batch on
option confirm off
option transfer binary
option synchdelete off
#只同步 *.h *.hpp *.cpp, 清除mask用命令:option include clear  
option include "*.h; *.hpp; *.cpp; */"
open scp://zc:123@192.168.1.128

#请确保/home/zc/project/doloio 已存在
cd /home/zc/project/doloio
lcd E:\zc\test\doloio
synchronize remote

close
exit

posted on 2012-05-15 10:57 多彩人生 阅读(999) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


导航

统计

常用链接

留言簿(3)

随笔分类

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜