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

martin

Re: REMOTE FOLDER SYNC TO LOCAL AND WINDOWS TASK SCHEDULER

Thanks for sharing your solution.
zen200

REMOTE FOLDER SYNC TO LOCAL AND WINDOWS TASK SCHEDULER

New Morning New Start.

So i decided to go out and have a nice drink and meal last night and to let my hair down.

I woke up with a fuzzy head and then sat in front of the pc once again to tackle this seemingly difficult task of getting task manager to work.

I looked at what I had left the settings at yesterday, and couldnt work out what I had done. So I started again from scratch and I got it working first time :shock:

So to clarify this is exactly what I did and hope it helps others.

Put the below into windows task schedule:

[b]Program/script:[/b]
"C:\Program Files (x86)\WinSCP\WinSCP.com"

[b]Add Argument:[/b]
/script=c:\scripts\script.txt /log="c:\scripts\logs.log"

---------------------------------------------------

Make a script as below and save it in the location c:\scripts\script.txt

[b]script.txt content [/b]

open ftp://USER:PASSWORD@SERVERIP/
synchronize local C:\LOCALFOLDER REMOTEFOLDER
exit

-------------------
replace the capitals with your own details.

Thats it i think.

Good luck
zen200

This works in command prompt on windows 2008 R2, but not in windows task schedule... Any ideas why ?

"C:\Program Files (x86)\WinSCP\WinSCP.com" /script=c:\scripts\script.txt

[b]SCRIPT FILE CONTENTS[/b]

open ftp://USER:PASSWORD@SERVERIP/
synchronize local C:\LOCALFOLDER /app/report/db
exit


Thanks

Phil
zen200

So the below does NOT work when put into the windows schedule task.

Program/script:
"C:\Program Files (x86)\WinSCP\WinSCP.exe"

Add Argument:
/command "open ftp://user:password@remoteipaddress/" "synchronize local C:\localfolder /remotefolder" "exit"


So I have turned to testing in the command prompt in windows 2008 r2, and have put the following in.

"C:\Program Files (x86)\WinSCP\WinSCP.exe" ftp://USER:PASSWORD@IPADDRESS/


This is the only way that I have been able to get winscp to open, connect and logged in. but I am unable to get the correct folders to open up automatically and then sync.

Please help, as I have been on this for days now.

[b]This is what I am needing to get working.[/b]

synchronize local C:\OLD SXE DB BACKUP /app/report/db
Guest

Re: some advice please

martin wrote:

Seems good.

I'd just add /log=c:\path\to\winscp.log to enable logging.


Thanks for the advice.

I haven't managed to get my above setup working for some reason.

I can get the program to open if I remove the argument, nothing happens when I put the argument back in though.

I must be doing something wrong.

This is on a server 2008r2 does that make any difference ?

Thanks for any help.
martin

Re: some advice please

Seems good.

I'd just add /log=c:\path\to\winscp.log to enable logging.
zen200

some advice please

This is my first attempt and will be putting this into a windows scheduled task to run nightly.

Will this work ?


Program/script
:
"C:\Program Files (x86)\WinSCP\WinSCP.exe"

Add Argument:
/command "open ftp://user:password@remoteipaddress/" "synchronize local C:\localfolder /remotefolder" "exit"

Thanks

Phil