Topic "remote sync - filemask to exclude a subfolder"

Author Message
[View user's profile]

Joined: 2013-08-22
Posts: 2
Location: Amsterdam
I'm trying to use WinSCP (5.1.7 on Windows 7) to set up an automated deployment of a .NET app to an SFTP server (Windows-based shared hosting).
Using the great documentation I was able to get this working except for one part.

I'd like the deployment to ignore a subfolder (e.g. /App_Data/logs/) and all files within.
I've tried to use the exclusion filemask in a dozen different ways but just cannot find the right formula - WinSCP still syncs the subfolder.

This is the command line I use:

winscp /command "option batch abort" "open s -hostkey=""ssh-rsa 2048 fingerprint""" "cd /web/content/" "lcd test" "ls" "lls" "synchronize remote -delete -nopermissions -transfer=binary -filemask=""|App_Data/logs/; App_Data/logs/*.*; App_Data/logs/*/*.*""" "close" "exit"

Result (console output) is:
Local 'C:\...\test\App_Data\logs' => Remote '/web/content/App_Data/logs'
Local 'C:\...\test\App_Data\logs' => Remote '/web/content/App_Data/logs'
'/web/content/App_Data/logs/logs.txt' deleted
C:\...\logs\logs2.txt | 0 KiB | 0.0 KiB/s | binary | 0%
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
You have to use file mask like: |*/App_Data/logs/

Martin Prikryl
[View user's profile]

Joined: 2013-08-22
Posts: 2
Location: Amsterdam
Brilliant, this works, thank you Martin.

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License