Topic "Auto keepuptodate"

Author Message
GhostWolfe
[View user's profile]

Joined: 2016-02-10
Posts: 4
Location: England
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:
Code:

"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):
Code:

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.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
WinSCP defaults to SFTP. So if you want to connect using FTP, you have to tell it explicitly, like open ftp://UserAccount@adomain.com
GhostWolfe
[View user's profile]

Joined: 2016-02-10
Posts: 4
Location: England
Thanks, working perfectly.
Just another question about sync option. Is it possible to have it uploading more than one file at a time?
troosters
[View user's profile]

Joined: 2016-02-11
Posts: 1
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)
GhostWolfe
[View user's profile]

Joined: 2016-02-10
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.
troosters2

Guest


But then user needs to be logged in all thentime?
GhostWolfe
[View user's profile]

Joined: 2016-02-10
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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
If you do not want the console window, use winscp.exe instead of winscp.com.

See https://winscp.net/eng/docs/executables
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License