synchronize remote -delete -filemask=|do-not-sync.txt will delete do-not-sync.txt if it is present.

Advertisement

hedgehog90
Joined:
Posts:
2

synchronize remote -delete -filemask=|do-not-sync.txt will delete do-not-sync.txt if it is present.

I've written a script to upload the latest changes to my website.
The script runs a winscp command like this:
synchronize remote -delete -filemask=|do-not-sync.txt
This results in do-not-sync.txt being deleted on the server but that is not what I want.
When I remove a file locally I want it removed from the server on being updated, so I need the -delete argument.
However there are files I don't want synchronized, but I don't want deleted either.
It looks like if the file doesn't match the specified filemask, it's not only ignored but also considered for deletion.
How do I make it so the list of negated files (with the | prefix) in filemask are NOT deleted on the server when I run synchronize remote -delete?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
38,189
Location:
Prague, Czechia

Re: synchronize remote -delete -filemask=|do-not-sync.txt will delete do-not-sync.txt if it is present.

Thanks for your post. I'll look in to it and I'll let you know.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
38,189
Location:
Prague, Czechia

Re: synchronize remote -delete -filemask=|do-not-sync.txt will delete do-not-sync.txt if it is present.

I've tested this, but I cannot reproduce the behavior you are reporting. For me the file is not deleted.

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

Advertisement

You can post new topics in this forum