Specifically, WinSCP will automatically respond to system notifications to avoid interruption in the middle of operation, then overwrite newly created files. Continue, log in to the FTP server based on the profile created above, change the directory structure (if necessary), pass the binary code (as opposed to ASCII ). Finally, the application will filter the diagram, FTP directory structure on the remote server, and transfer the necessary files to the specified directory. You can refer here .
Before running or editing this script, you should create a test directory on local and remote computers (to avoid possible confusion). On the local machine, we create the testlocal directory (here is F: backups ) and testremote on the FTP server. Then, run the script, if successful, save the above code into any folder on your computer.
For the rest of the process, we'll let Windows do it - based on the built-in Task Scheduler feature. You open Control Panel> System and Security> Administrative Tools> Task Scheduler:
In the right window, click Create Basic Task:
Give a short name and description for this operation, click Next to continue:
The next option is the operation mode over time, in this test, we want the script to run every time the computer starts. So you choose When the computer starts:
On the next screen, select Start a program and click Next . The system will ask us to point the path to the file to be executed. Click the Browse button and point to C: Program FilesWinSCPWinSCP.exe . Below, you enter:
/ console /script=f:backupsync.txt /log=f:backuplog.txt
Change the details at this argument as appropriate
After that, the system will display all general information as well as details of the whole process, check again and click Finish . And to make sure the system will work as expected, you should click the Run button to make sure there are no errors arising:
Very simple and easy, wish you success!