Use Winscp to synchronize files from Linux to Windows

Source: Internet
Author: User

1. Download Winscp4.2.7 and install it. The address will not be pasted. There should be many google URLs.

2. After the installation is complete, log on to the system using a graphical interface to obtain the Linux server key cache... [do not omit this step], and save and modify the settings.

3. Write an automatic synchronization script file

# 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] @] # Open user: password@example.com
# Connect FTP address
Open user: pwd @ ip

# Change remote directory
# Cd/home/user to remote directory

Cd/root

# Change local directory
# Set to Self's working dir setting local file directories to be synchronized to remote FTP
LCD E: \ files

# 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>] use Local to synchronize data from a Remote location to a remote location.
Synchronize local

# Disconnect
Close

# Exit WinSCP
Exit

4. Compile the bat file

"% Winscp setupPath % \ Winscp.exe"/console/script = absolute path for synchronizing script files

5. Put it in the windows scheduled task.

Finished...

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.