nice to be a new member!
I need to synchronize a local folder with remote SFTP folder.
I have two way to do that and I think the first is the best.
My folder tree have a complete
in my local PC with inside several paths
the folder names are
and inside year there are only 12 folders as months and inside months several files, .csv files
I think that I've 2 ways to do that:
- by create the remote path folder tree based in the actual year actual month. Get the actual date and create path by
mkdir create the remote folder if not exist (or also if exist) and send the file one by one per times via
put command in that folder.
- by synchronizing my whole
FOLDER with remote root folder with command
Each time the script sync everything.
The second is the faster I think and I've tried to do that with below scripts and something went wrong.
option echo off
option batch on
option confirm off
# OPEN CONNECTION TO
# I can't put SFTP credential here but I generate the open code via WinSCP generate code.
# SET LOCAL FOLDER PATH
# SET REMOTE SERVER PATH
# COMMAND TO SYNC