Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

GhostWolfe

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.
troosters2

But

But then user needs to be logged in all thentime?
GhostWolfe

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.
troosters

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)
GhostWolfe

Thanks, working perfectly.
Just another question about sync option. Is it possible to have it uploading more than one file at a time?
martin

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
GhostWolfe

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.