Filemask in place but not working
I use the WinSCP (5.7.4) powershell script that will move all files in a remote folder from the SFTP server. The issue I have is partly because of the bad design of the folder structure (where I have no influence at)
I have a root folder for user 'ftp01' and that folder contains the following (sub)folders with XML files in it.
EXCLUDE FOLDERS:
ROOT (/cygdrive/c/program files (x86)/icw/home/ftp01/Input)
I want the script to fetch all xml files from ALL subfolders named 'test' and move them to my local directory with one script and kick it off with a windows scheduled task.
If I point the script to only one "test" folder the script works perfectly, but when I use ROOT folder as remotepath and experiment with i.e. filemasks it won't work.
I can clone the script a couple of times with a different remotepath but then I have to maintain 6 scripts and I think it can be so much better.
I use CopSSH server for windows 2008R2. I attached the script to the post.
I hope you can help me out.
Thanks in advance!
Regards,
Remy Bosma
I have a root folder for user 'ftp01' and that folder contains the following (sub)folders with XML files in it.
EXCLUDE FOLDERS:
/cygdrive/c/program files (x86)/icw/home/ftp01/Input/folderA/acc/ /cygdrive/c/program files (x86)/icw/home/ftp01/Input/folderA/prod/ /cygdrive/c/program files (x86)/icw/home/ftp01/Input/folderB/acc/ /cygdrive/c/program files (x86)/icw/home/ftp01/Input/folderB/prod/
| -->FolderA | | | -->test (I want these XML files) | -->acc | -->prod | -->FolderB | | | -->test (I want these XML files) | -->acc | -->prod
If I point the script to only one "test" folder the script works perfectly, but when I use ROOT folder as remotepath and experiment with i.e. filemasks it won't work.
I can clone the script a couple of times with a different remotepath but then I have to maintain 6 scripts and I think it can be so much better.
I use CopSSH server for windows 2008R2. I attached the script to the post.
I hope you can help me out.
Thanks in advance!
Regards,
Remy Bosma