Topic "Help with Syncronizing"

Author Message
jpjohnson

Guest


We would like to


1. Sync ANY file or folder new or modified RECURSIVELY.
2. From Local to SFTP
3. Excluding thumbs.db (yes we can just have windows not create them but I would still like to know how to exclude a file)

Currently it is not syncing modified folder/files but rather everything
Currently it seems to only sync sub folders and contents through 8 directories fromm local.

We would like it to recurse through all sub directories. Yes these paths can be 10 to 20 directories deep.

Below is the code in the txt file winscp is following:

Code:
option batch continue
option confirm off
option synchdelete on
open WGDJobInfoSync
lcd \\servername\Company\Jobs
synchronize -filemask="*.db" remote "\\servername\Company\Jobs" "/TESTING/Jobs_TEMP"
exit
Advertisements
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
You have to add the *.db to exclude, not include mask:
synchronize -filemask="|*.db" remote "\\servername\Company\Jobs" "/TESTING/Jobs_TEMP"
See https://winscp.net/eng/docs/file_mask
techracer
[View user's profile]

Joined: 2017-09-12
Posts: 5
Location: ohio
I reviewed numerous posts and followed Site Admin Martin's advice but I cannot get the filemask to work to exclude files in the source tree when syncing. Here is what I added to my known-good script, and when this is added the script aborts with no visible error:

-filemask="|thumbs.db"

The script below shows what I am doing. This script works fine without that option. I placed z's in place of actual values to protect the confidential parts. I also tried

-filemask="|*.db"

in case you can't exclude a specific file, and also tried putting these strings before and after "remote" and nothing worked. I love WinSCP and would appreciate any help I can get because excluding files during a sync would be a really handy option to have.

"C:\1data\portableapps\WinSCP\WinSCPPortable\App\winscp\WinSCP.com" ^
/log="C:\1data\portableapps\WinSCP\WinSCPPortable\WinSCPlog_ts_master_documents_folder.log" /ini=nul ^
/command ^
"open sftp://zzzz:zzzz@zz.zzz.zzz.zz:zzzz/ -hostkey=""zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz""" ^
"lcd ""f:\""" ^
"cd /" ^
"synchronize -filemask="|thumbs.db" remote -delete ""F:\TS MASTER DOCUMENTS"" /""TS MASTER DOCUMENTS""" ^
"exit"
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
You have to double the inner double-quotes:
"synchronize -filemask=""|thumbs.db"" remote -delete ""F:\TS MASTER DOCUMENTS"" /""TS MASTER DOCUMENTS""" ^

See https://winscp.net/eng/docs/commandline#syntax
techracer
[View user's profile]

Joined: 2017-09-12
Posts: 5
Location: ohio
Thank you, Martin! Your reply was very quick and accurate. I tested the double quotes several times and it worked every time.

Thanks again!
Advertisements

You can post new topics in this forum

Search

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