backup data using winscp sftp/ssh

Setup linux server to take ssh connections so you can transfer files to directory on server.

Create these two scripts on your windows box and run them, should backup all files to server and then whenever you run it again it will sync data to server.

backup.bat

@echo off
SET dateNtime=”%date:~3,2%-%date:~6,6%”
“c:\Program files\winscp\winscp.com” /script=script.txt

script.txt

option exclude “*.mp3; *.mp4; *.lnk; *.exe; *.msi; My Pictures; My Music; My Videos; @college; .metadata;”
option batch on
option confirm off
# Connect - format: user:password@host
open USER:PASSWORD@SERVER
# Force binary mode transfer
option transfer binary
# Upload files to remote directory
synchronize remote C:\FILES /home/USER/recent
# Disconnect
close
# Exit WinSCP
exit

Should be able to also setup schedule in windows to run every day at certain time (you must have password entered when creating this schedule)

hope ya like

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.