New to scripting...and stuck!

Advertisement

floatingshed
Guest

New to scripting...and stuck!

I regularly use winscp to synchronise two ftp folders manually, always with great success.
I thought it would be nice to do this automatically, scheduled by windows task scheduler.

The manual method I use is: Log-in and have both directories on screen. From the commands menu choose Synchronize. Select "local", "mirror" and nothing ticked in comparison data (I have my reasons!). This achieves the result I want every time.

I'd be most grateful if someone could give me a partial script as a starting point, or point me in the right direction to achieve the same result.

Many thanks.

Reply with quote

Advertisement

Guest

OK, thanks for the pointers. I've had some success with this script:

option batch abort
option confirm off
open ftp://username@remote site
synchronize local "d:\test winscp" "/test winscp" -mirror -criteria="none"

It copies material from the remote site to the local directory but doesn't delete obsolete local files. Anyone know why not?

Thanks.

Reply with quote

Advertisement

blackmagic88
Joined:
Posts:
1

martin wrote:

It copies material from the remote site to the local directory but doesn't delete obsolete local files. Anyone know why not?
You are missing -delete switch:
https://winscp.net/eng/docs/scriptcommand_synchronize

I'm using version 5.1.7 but when use
synchronize remote -delete "\\Server1\LocalDirectory" "/ServerDest/RemoteDirectory" it says too many parameter for command 'synchronize'.
Can you help me with this? many thanks in advance.

Reply with quote

Floatingshed
Guest

Thanks, got it working now.

Next problem... my ftp server has 24 directories but I only want to synchronize 20 of them. I have read the documentation and once again it is not clear, the section on masks it utterly baffling. In SIMPLE language how do I exlude certain directories?

Thanks.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Floatingshed wrote:

In SIMPLE language how do I exlude certain directories?
What did you try already? So that we can show you what did you wrong?

Reply with quote

Advertisement

You can post new topics in this forum