Auto keepuptodate

Advertisement

GhostWolfe
Joined:
Posts:
4
Location:
England

Auto keepuptodate

I've been looking for the script for this but so far it doesn't seem to wan to work for me.
I want to have a sync between two servers that will add new and delete old from the destination.

I have got as far as the getting the following but it's not even registering on the remote server that it's trying to connect.

Batch file runs:
"C:\Program Files (x86)\WinSCP\winscp.exe" /command /script-C:\Datastore\SC2-Script.txt /log=C:\DataStore\WinSCP.log

Script is set to (the files to sync are in the root directory when you log into the FTP):
option batch on
option confirm off
option batch continue
open UserAccount@adomain.com
keepuptodate -delete -resumesupport=on Q:\DE /

Where am I going wrong?
All help is appreciated.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,453
Location:
Prague, Czechia

Re: Auto keepuptodate

WinSCP defaults to SFTP. So if you want to connect using FTP, you have to tell it explicitly, like open ftp://UserAccount@adomain.com

Reply with quote

troosters
Joined:
Posts:
1

auto

Hi,

I made a .bat file with :

@echo on

"C:\Program Files (x86)\WinSCP\WinSCP.com" /ini=nul /command "option batch continue" "option confirm off" "open ftp://admin:password@1.1.13.107/" "keepuptodate -resumesupport=on D:\Mainfolder\folder /Mainfolder/FOLDER"


set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)
pause
exit /b %WINSCP_RESULT%

, BUT does the .bat windows need to be open all the time then ?

My goal is to make a realtime sync between a local and a remote server.
where data from the local server is mirrored to the remote server. (this remote server runs Filezilla Server)

Reply with quote

GhostWolfe
Joined:
Posts:
4
Location:
England

yes, you will need to keep it running.

A schedule task set to start when the system boots and checks every 5 minutes to make sure it's running should help keep it running.
It's the same set up I am using to do a similar task.

Reply with quote

Advertisement

GhostWolfe
Joined:
Posts:
4
Location:
England

Not if you set the Scheduled Task to run to "Run whether user is logged on or not".
It will run the batch file with the credentials you specify in the background.
If the task is set to run at startup then it will run as soon as your machine boots up.
And it's always an idea to select the "Run with highest privileges" box.

Reply with quote

Advertisement

You can post new topics in this forum