File synchronization method using WinSCP script – downloading modified files from remote server, useful way to backup files through SSH | |||
| |||
WinScp provides straightforward way can synchronize between local and remote server, if remote server has SSH daemon. Actually this is useful if you need to manage files on multiple places. Actually I use this script for purpose of backup files on my PC. Following example, shows the simple example.
winscp_com_backup.bat 1: winscp /script=winscp_backup.scp
winscp_backup.scp 1: # winscp file sychronization example
2: #
3: # sample script by Chun Kang (kurapa@kurapa.com) - 2013-07-29
4: option batch abort
5: option confirm on
6: open sftp://your_id:your_password@server_domain_name -hostkey="ssh-dss 1024 97:4a:45:f9:be:54:1e:b0:6b:59:ca:c2:5a:9d:99:db" 7: # synchronize local -> download modified files from remote server
8: # synchronize remote -> download modified files from local
9: # synchronize both -> synchroize both way
10: synchronize local "local_directory" "remote_server_directory" -transfer=binary 11: close
12: exit
Above example is the simple example synchronizing files from remote server. You can simple change the direction from local to remote server by changing option as following. 1: synchronize remote "local_directory" "remote_server_directory" -transfer=binary
If you need to synchronize both way, you can do it by changing option as both. Please see below. 1: synchronize both "local_directory" "remote_server_directory" -transfer=binary Note that winscp.exe, and winscp.com file must be located on the same directory to perform above files. If not, please locate both winscp.exe and winscp.com to system directory. You can download the portable executables at http://winscp.net/eng/download.php#download2 [ download example ] Tags: EmailDomain FNC File Manager File Synchrnonization MP3 Phone SSH UTF8 WinAMP backup local remote upload | |||
| |||
| |||
Login for comment |
SIMILAR POSTS Check if a file exists from inside a batch file |
OTHER POSTS IN THE SAME CATEGORY Enable/Disable IPv4 on Windows |