File synchronization method using WinSCP script – downloading modified files from remote server, useful way to backup files through SSH

CK1820 
Created at Jul 29, 2013 07:59:36 
141   0   0   0  

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 Share on Facebook Share on X

◀ PREVIOUS
Remote Desktop not work after SP3 installation ?
▶ NEXT
Check if a file exists from inside a batch file
  Comments 0
Login for comment
SIMILAR POSTS

Check if a file exists from inside a batch file (updated at Dec 21, 2023)

FNC(Photo/Video File Name Changer) v1.02 release - The file created date time information is available for those cameras providing incorrect EXIF data (updated at Dec 20, 2023)

FNC(Photo/Video File Name Changer) v1.01 release (updated at Dec 20, 2023)

FNC(Photo/Video File Name Changer) v1.0 release (updated at Dec 20, 2023)

File conversion to UTF in Schell Script (created at Jan 19, 2009)

Server status checking by Shell Script (created at Apr 01, 2008)

Extracting the domain (host) name from an e-mail address (created at Sep 17, 2007)

Content Manager for The world’s first MP3 Phone (created at Jul 31, 2000)

MusicDrive – DRM enabled Secure Music Player on Microsoft Windows (created at Feb 16, 2000)

OTHER POSTS IN THE SAME CATEGORY

Enable/Disable IPv4 on Windows (updated at Feb 24, 2024)

Enable/Disable IPv6 on Windows (updated at Feb 24, 2024)

Check if a file exists from inside a batch file (updated at Dec 21, 2023)

Remote Desktop not work after SP3 installation ? (created at Dec 15, 2008)

How to make application speed faster (updated at Jan 02, 2024)

Changing ANY user password without having to know the existing password (created at Dec 06, 2007)

Windows XP Internet Connection Sharing: Port Forwarding Difficulties (updated at Jan 15, 2024)

Editing your Web browser's settings for faster loading of pages (updated at Jan 02, 2024)

Increase bandwidth by tweaking QoS in Windows XP Pro (created at Sep 03, 2007)

Tweak DNS Errors Caching in Windows 2000 / XP (created at Sep 03, 2007)

Stop the system automatically rebooting after Windows Updates (created at Sep 03, 2007)

How to change the listening port for Remote Desktop? (created at Aug 31, 2007)

UPDATES

Creating a Pinterest-Style Card Layout with Bootstrap and Masonry (created at Apr 24, 2024)

Mastering Excel Data Importation in PHP (updated at Apr 24, 2024)

JSON format control in PHP (updated at Apr 24, 2024)

Equal Height Blocks in Bootstrap with JavaScript (created at Apr 22, 2024)

How to convert integer to text string ? (updated at Apr 22, 2024)

Checking similarity between two strings in PHP (updated at Apr 21, 2024)

Create Blob Image in HTML based on the given Text, Width and Height in the Center of the Image without saving file (updated at Apr 21, 2024)

How do I determine the client IP type (IPv4/IPv6) in PHP (updated at Apr 16, 2024)

How do I determine the client IP type in Python - IPv4 or IPv6 (updated at Apr 13, 2024)

Getting Started with PyTorch: A Beginner's Guide to Building Your First Neural Network (updated at Apr 09, 2024)

Predicting Buyer Preferences with PyTorch: A Deep Learning Approach (updated at Apr 09, 2024)

Forecasting the Weather with PyTorch: A Beginner's Guide to Temperature Prediction (created at Apr 09, 2024)

PyTorch example to Forcast Stock Price based on 10 days Dataset (created at Apr 09, 2024)

Mastering Model Persistence: Saving and Loading Trained Machine Learning Models in Python (created at Apr 08, 2024)

Harnessing the Power of Random Forest Algorithm in Python (created at Apr 08, 2024)

Understanding and Implementing K-Nearest Neighbors (KNN) Algorithm in Python (created at Apr 08, 2024)

Forecasting with Linear Regression and KNN Regression in Python (updated at Apr 07, 2024)

What is 302 Found Redirection in HTTP 1.1? (created at Apr 04, 2024)

Mastering Random Forest Regression: A Comprehensive Guide with Python Examples (updated at Apr 01, 2024)

Python Implementation of Linear Regression (updated at Apr 01, 2024)

Mastering Supervised Machine Learning with Python: A Comprehensive Guide (created at Apr 01, 2024)

Mastering AI: A Beginner's Guide to Python Programming and Beyond (created at Apr 01, 2024)

How do I create animated background for Google Meet? (updated at Mar 28, 2024)

Building a Simple DNS Server in Delphi with TTL Support (created at Mar 16, 2024)

How to force cookies, disable php sessid in URL ? (updated at Mar 16, 2024)

Implementing a Versatile DNS Server in PHP: Handling A, AAAA, CNAME, and TXT Records (updated at Mar 16, 2024)

Implementing a Versatile DNS Server in Python: Handling A, AAAA, CNAME, and TXT Records (created at Mar 16, 2024)

Building a Basic DNS Server in PHP/Python: A Beginner's Guide (updated at Mar 15, 2024)

Dynamic DNS Made Easy: Building a Python-Based Solution (created at Mar 15, 2024)

Exploring the Depths of Data Transfer: sendfile vs. kTLS (created at Mar 15, 2024)