The file synchronization process is configured to transfer files from a Linux server to a Windows server using the SFTP protocol and WinSCP command-line utility.
The source directory on the Linux server is:
/Your_Source_Directory/
The destination directory on the Windows server is:
C:\Users\Desktop\Your_Destination_Directory
WinSCP is configured in batch mode so that the file transfer can be executed automatically without manual intervention.
The synchronization script is: sync_prod.txt
option batch on
option confirm off
open sftp://OS_User_Name:Password@Source_Server_IP/synchronize local "C:\Users\Desktop\Your_Dest_Dir" "/Your_Source_Dir/"
exit
The command used to execute the script is:
"C:\Program Files (x86)\WinSCP\WinSCP.com" /log="C:\Users\Desktop\Your_Dest_Dir\winscp_sync.log" /script="C:\Users\Desktop\sync_prod.txt"
Synchronization Direction
Linux Server
Source_Server_IP
|
| SFTP
| /Your_Source_Directory/
↓
Windows Server
C:\Users\Desktop\Your_Destination_Directory
The synchronize local command ensures that the local Windows directory is
synchronized with the remote Linux directory.
The WinSCP log file is generated at:
C:\Users\Desktop\winscp_sync.log
This log can be reviewed to verify successful transfers, skipped files,errors
, and synchronization activity.
NOTE:
synchronize local = remote Linux → local Windows
synchronize remote = local Windows → remote Linux
Purpose
This setup can be used to automate the transfer of files such as invoices,
reports, documents, or other application-generated files from the Linux
server to the Windows server without requiring users to manually download
the files through an SFTP client.