Topic "Synchronize and Mask Command"

Author Message
knockando
[View user's profile]

Joined: 2010-11-04
Posts: 14
I'm trying to sync only *.tar.gz files to my local directory.

This works and syncs ALL files in /pce/data/test:
synchronize local -delete C:\apps\TransferHolding\pce\xmldata /pce/data/test/

This doesn't work, gives me Error listing directory '/pce/data/test/*.tar.gz'. No such file or directory:
synchronize local -delete C:\apps\TransferHolding\pce\xmldata /pce/data/test/*.tar.gz.

I've looked all over and the only thing I can find is 'Existing files only' but I'm not sure how to set that via scripting. I know my Mask is correct b/c 'ls /pce/data/test/*.tar.gz' returns my one file.

Thanks!
Advertisements
knockando
[View user's profile]

Joined: 2010-11-04
Posts: 14
Put this in before executing the sync command but transferring all files, not just *.tar.gz

.WriteLine("option include *.tar.gz")
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Please post your complete script file.
_________________
Martin Prikryl
knockando
[View user's profile]

Joined: 2010-11-04
Posts: 14
Dim winscp As Process = New Process()
winscp.FileName = "C:\Program Files\WinSCP\WinSCP.com"
winscp.Start()
.WriteLine("option batch abort")
.WriteLine("option confirm off")
.WriteLine("open sftp://" & username & ":" & password & "@" & remotehost)
.WriteLine("option include "*.tar.gz"")
.WriteLine("synchronize local -delete -criteria=time C:\apps\TransferHolding\pce\data\ /pce/data/AndyTest/")

I'm not getting errors back from

message As XPathNavigator In nav.Select("//w:message", ns)

Another note, I've tried this exact same script by manually typing the commands using WinSCP.com and it worked.

Thanks!
knockando
[View user's profile]

Joined: 2010-11-04
Posts: 14
I changed
.WriteLine("option include "*.tar.gz"")
to
mask = "*.tar.gz"
.WriteLine("option include" & " """ & mask & """")

and it's working.
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