Post a reply

Options
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)

Options

Topic review

Bejbas

I resolved my issue using this one:
$wildcard = "*.log |  */",
Bejbas

I got it!
It's working perfectly.

Last question I hope.
Is there any option to exclude folder/folders. I wanted to use: |*/nsx/metrics/ but it doesn't work.
martin

That only adds the option to the dialog. Now you need to link that option to the code, the way for example the RemotePath/LocalPath are.
Bejbas

Hi Martin. Thanks for your reply.
Using extension with GUI.
I was trying add this one:
# @option       Wildcard -run textbox "File mask:" "*.log" 

but still doesn't not work.
martin

Re: Keep local directory up to date | file mask doesn't work

Do you mean that you want to restrict the synchronization to *.log files only?
Are you planning to use the script manually? Or as an extension in WinSCP GUI?
If the first => so if you just want to hard-code the restriction, use:
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.FileMask = "*.log"
$differences =
    $session.CompareDirectories(
        [WinSCP.SynchronizationMode]::Local, $localPath, $remotePath,
        $delete, $False, [WinSCP.SynchronizationCriteria]::Time,
        $transferOptions)

(not tested)
Bejbas

Keep local directory up to date | file mask doesn't work

Hi!
First of all thanks for this app. It's realy realy good!
I am looking for any way to modify script:
Keep local directory up to date (download changed files from remote SFTP/FTP server)
which allows me to keep up to date but files with .log extensions.
I was trying modify PowerShell adding line:
# @option       Mask -config textbox "&File mask" "*.log"

but it doesn't work.
I will be appreciate for your help.
Thank you in advance