Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-07-2019, 07:24 PM
dverbern dverbern is offline
Registered User
 
Join Date: Mar 2019
Posts: 29
Automating VSFTP (VShell) - Prefer PowerShell, VBScript also OK

Hello,

I'm an absolute newbie who knows the basics of how to use VShell (VSFTP) via the command-line and is looking to automate via a script the following:

1. Connect to a remote host (w/key, keyphrase, username)
2. Navigate to a remote folder
3. Get list of files, see if they match a particular regular expression or similar
4. Download those matching files to a local folder.
5. Disconnect.

I've got scripts that do this sort of thing for WinSCP but I'd like to use VSFTP. My scripting prowess is limited to PowerShell these days but still reasonably comfortable with VBScript.

Any examples or assistance much appreciated.

Daniel V
Reply With Quote
  #2  
Old 07-08-2019, 11:41 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,049
Hi Daniel,

What are the specific patterns (regular expressions) you will be matching on?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 07-08-2019, 05:31 PM
dverbern dverbern is offline
Registered User
 
Join Date: Mar 2019
Posts: 29
In this instance, the regex I have come up with is as follows:

^MDFFL\d+GLOBALM_YARRAVALLE.csv.zip$
Reply With Quote
  #4  
Old 07-09-2019, 03:13 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,049
Hi Daniel,

Sorry, I don't have any suggestions for you. You can use wildcards with vsftp but your needs seem a bit beyond that. Hopefully someone in the community will have a solution.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 07-09-2019, 06:24 PM
dverbern dverbern is offline
Registered User
 
Join Date: Mar 2019
Posts: 29
Hi Brenda,

No problems. In this instance, I decided to utilise an existing installation of WinSCP on our SFTP server, taking advantage of the WinSCP .NET Assembly and COM Library to use with Microsoft PowerShell, I then configured my script to run periodically with Task Scheduler on the SFTP server. Its a shame that for whatever reason the VShell wouldn't play nicely with this particular 3rd party SFTP server I was connecting with (without needing an additional sftp-version switch), but I'm happy with the support you've provided and we continue to use VShell for the rest of our corporate SFTP usage scenarios.

Happy for this ticket to be marked closed if that's how it works.
Reply With Quote
  #6  
Old 07-10-2019, 10:47 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,049
Hi Daniel,
Quote:
Its a shame that for whatever reason the VShell wouldn't play nicely with this particular 3rd party SFTP server I was connecting with (without needing an additional sftp-version switch)...
As I tried to clarify in the other thread we had together, the issue is not with vsftp (the command-line sftp client included with your VShell installation). The issue is with the SilverSHielD server you are connecting to.

One of our developers (having done analysis of a log of a connection where change directory failed) wrote an email to that vendor (in 2012) and stated:
Quote:
Notice that we have specified the control-byte as SSH_FXP_REALPATH_STAT_ALWAYS (0x03).
When the SilverSHielD responds, it sends the following packet:
[packet_info_redacted]
You will note that it* has sent no attributes and an invalid/illegal type code of zero. This causes our sftp client to think that directory files aren't actually directories and fail to complete a change directory operation.
*The it in above sentence being the SilverSHielD server's response to the sftp client request.

And the SilverSHielD developer's reply was:
Quote:
yes you're actually absolutely right. This was working in SilverSHielD up to version 4.x, but has been "broken" in v5.0 and we weren't aware of that. A customer has informed us few days ago and we were already working on the issue.

A fix will be available in the upcoming version 5.4 which will be released in 10-15 days from now.

Since you are now connecting to version 6 of that server software...
[LOCAL] : VENDOR-NAME: Extenua
[LOCAL] : PRODUCT-NAME: SilverSHielD SSH2/SFTP Server
[LOCAL] : PRODUCT-VERSION: 6.0.0
[LOCAL] : PRODUCT-BUILD: 0000000000000000
...either the same SilverShielD bug was re-introduced or it was never fixed.

So you (or the SFTP server admin) should contact SilverSHielD about this issue.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730

Last edited by jdev; 07-10-2019 at 12:23 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 09:01 AM.