Topic "synchronize per CLI: excluded folders are synchronized anyway"

Author Message
mansmans

Guest


Hi,

this is my actual command:

Code:
synchronize local -delete -mirror -filemask="|/www/app/config/parameters.yml;/www/var/cache/;/www/var/logs/; /www/vendor/;" -criteria=either www www


Basically I just want to mirror the folder
Code:
www
from REMOTE to LOCAL despite a few files and folders. The excluded files and folders I want to keep at LOCAL.

The Problem:
For example I want to exclude the /www/var/cache directory from being synchronized.
This works fine if the directory doesn't exist in LOCAL. But if it does, it will just be synchronized anyway, or even just the first few folders of it.

Am I doing something wrong?

Greets, mansmans
mansmans
[View user's profile]

Joined: 2016-08-19
Posts: 1
So, I tried some more things and it seems the problem was the leading slash. When I remove it, it seems to work fine.

Code:
synchronize local -delete -mirror -filemask="|www/app/config/parameters.yml;www/var/cache/;www/var/logs/;www/vendor/;" -criteria=either www www


Update
Nope, the only way I got this really working was to add the masks with and without leading slashes:
Code:
synchronize local -delete -mirror -filemask="|/www/app/config/parameters.yml;www/app/config/parameters.yml; /www/var/cache/;www/var/cache/; /www/var/logs/;www/var/logs/; /www/vendor/;www/vendor/;" -criteria=either www www


With leading slashes only the folders get synchronized anyway if they exist.
Without leading slashes only the folders get synchronized anyway if they don't exist.

Only using the paths with leading slashes AND without leading slashes they are really excluded.

Maybe someone can explain why that is so.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
See https://winscp.net/eng/docs/file_mask#path
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