Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

Makc666

Re: ignore failure and return status code 0 when no file is there at SFTP

DaveKalra wrote:

This above code always return status code 1 when file is not available .added code "failonnomatch off" but log didn't return status code 0


Try to replace
c_commandStr = c_commandStr & chr(34) & "get -delete -nopreservetime " & m_clientFileName & chr(34) & "
with something like:
  • move all files to another directory which is only for your operations
  • then try to get files from that another folder them without -delete
  • then make rm * on that another folder
martin

Re: ignore failure and return status code 0 when no file is there at SFTP

The piece of the code you have posted does not explain, what problem you have with continuing on another server.
DaveKalra

ignore failure and return status code 0 when no file is present at SFTP

Hi marc need your help to resolve the issue
DaveKalra

ignore failure and return status code 0 when no file is there at SFTP

Makc666 wrote:

No one will help until will see the script.

I don't understand why you can't make a code which will look if there any file on the host and if "No" go forward.



c_commandStr = """C:\Program Files (x86)\WinSCP\WinSCP.com""" & " /command "
c_commandStr = c_commandStr & chr(34) & "open sftp://" & m_strFTPLogin & ":" & m_strFTPPassword & "@" & m_strFTPAddress & chr(34) & " "
c_commandStr = c_commandStr & chr(34) & "cd "& m_strFTPRemoteFolder & chr(34) & " "
c_commandStr = c_commandStr & chr(34) & "option failonnomatch off" & chr(34) & " "
c_commandStr = c_commandStr & chr(34) & "get -delete -nopreservetime " & m_clientFileName & chr(34) & " "
c_commandStr = c_commandStr & chr(34) & "close" & chr(34) & " "
c_commandStr = c_commandStr & chr(34) & "exit" & chr(34) & " "
c_commandStr = c_commandStr & "/log="& m_strLogPath & "sftp_" & ArgObj(0) & "_" & "Tabb_" & m_filedate & ".log"


This above code always return status code 1 when file is not available .added code "failonnomatch off" but log didn't return status code 0
Makc666

No one will help until will see the script.

I don't understand why you can't make a code which will look if there any file on the host and if "No" go forward.
DaveKalra

ignore failure and return status code 0 when no file is there at SFTP

Hi Martin need your help to resolve this type of issue
DaveKalra

ignore failure and return status code 0 when no file is there at SFTP

I have three different sftp location where file is coming at specific time .job runs vbscript which runs winscp commands to download files from three different SFTP location .when there is no file at sftp location then job gone to long execution state because status code 1 is coming from vbscript .I want to return status code 1 so that other instance will run .I tried to handle this situation in vbscript but cant do it.Help is really appreciated