Topic ""option exclude" with list of directories"

Author Message
dtgriscom
[View user's profile]

Joined: 2007-06-27
Posts: 13
Location: Wakefield, MA
I'm writing a batch file to synchronize a server directory with a local directory. However, there are a set of subdirectories that I want WinSCP to ignore.

Easy: just set up an "option exclude" line that lists all the ignored directories, separated by semicolons, right? Well, it doesn't work for me. Here's the script:

Code:
option batch on
option confirm off
option transfer binary
option synchdelete on
option exclude "C:\TopDir\GFLogs\*;C:\TopDir\PostgreSQL\*;C:\TopDir\Apache\*;C:\TopDir\PHP5\*"
open xxxxxx:yyyyyyy@zzzzzzz.com
synchronize local C:\TopDir /home/dang/working/TopDir


As far as I can tell, this has no effect on WinSCP; when the batch file is run, WinSCP starts right into updating C:\TopDir\Apache\* to match /home/dang/working/TopDir/Apache/*.

How can I handle this? I'd rather not separately list the subdirectories to be synchronized, as new ones get added from time to time and the new ones need to automatically synchronize.

Thanks,
Dan
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
You are synchronizing remote directory into local one. Hence you must exclude the remote directories (being source), not the local ones.
_________________
Martin Prikryl
dtgriscom
[View user's profile]

Joined: 2007-06-27
Posts: 13
Location: Wakefield, MA
That makes sense, but brings up another question: if I've got "option synchdelete on" included, that deletes any files in the target directory tree that don't match a file in the source directory tree. If I (successfully) exclude a source directory, does that mean that any corresponding directory on the target machine will get deleted?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
It will. But you can exclude also the remote directories to avoid that.
_________________
Martin Prikryl
suraj

Guest


hi,
is there any option in ls command so that it exclude a particular pattern of file from listing
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
suraj wrote:
hi,
is there any option in ls command so that it exclude a particular pattern of file from listing

No. But you can script this in PowerShell easily:
https://winscp.net/eng/docs/library_example_listing_files_matching_wildcard
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