Friday, June 17, 2011

Automatic Windows File backup to remote ssh server using winscp

Recently i found that winscp can be used to transfer file automatically to your ftp/sftp/ssh servers without manual interaction through your windows machine.

 

This is how.

Scenario: I wanted to schedule backup of my E:/DATA folder to my linux backup server /data folder using ssh in syncchronize manner.

Solution:

First you have to install WINSCP. Winscp comes with two utilities.

1.winscp.exe - the GUI version.

2.winscp.com - the command line version .

Now create a session for ssh using winscp.exe gui , mention the password also. save the session with some name for example "databackup"

Winscp ssh connection

Now here is the command line.

"C:\Program Files\WinSCP\WinSCP.com"  /command "open databackup" "synchronize remote E:\DATA /data" "exit"

This command will connect to your server using session "databackup" which you created and saved using winscp.exe gui interface.

You can create a windows schedule task to run this command periodically.

That's IT..there is lot more to explore winscp....explore your self.

 

 

No comments: