Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


This works like a charm. Thank you very much!

Re: filemask for directories? workaround possible?

It seems that you would be happy with selecting files (not folders) by the timestamp, what is possible, as you know.

To avoid creating the empty folders, use ExcludeEmptyDirectories raw transfer setting:

Or use your PowerShell script, just replace Session.PutFiles with Session.SynchronizeDirectories(SynchronizationMode.Remote, ...)

filemask for directories? workaround possible?

I'd like to transfer the content of a local folder with sub-folders to a remote server. Only folders created in 2020 year should go to a specific remote folder, e.g.:

folder1 (created 2019)
folder2 (created 2020)

I've tried a "synchronize" script with a specific file mask. This works in principle but creates empty folders on the remote site for the 2019 local folders.
I found out that a filemask for directories is not possible.
So I've written a powershell script with "session.PutFiles" and selecting folders with "Get-ChildItem" by date. This again, works in principle but transfers folders that have been already transferred in a previous session again. Here I'd need something like "-neweronly", which seems to be not possible in powershell scripts.
I guess it is possible to compare a list of folders from the remote site with a list of local folders and transfer only folders which are not present on the remote server. But before I start writing such a script for powershell I'd like to ask if there is a more convenient or easy way to achieve a folder selection. Something like a filemask for directories would help. Thanks you very much in advance for your answer!