This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Remote SSH Shell Script Issue - command for waiting for output

Hello everyone,


I've spent some time this week trying to get things going in a SSH Shell (/Base [1.21.7]/Library/Operations/Remote Command Execution/Remote Shell) but despite my efforts I'm still stuck with management breathing down my neck.

The context is that I have to automate the "cleaning" of 9 files some as large as 5GB and the issue is that the SSH remote shell step does not wait for the full command to finish before marking it as resolved and jumping to the next step which is a powershell step containing an upload to Google bucket function. It cleans maybe 100 something MB of data and marks and then uploads it right away. 

What can I use to overcome this?

The step Inputs I use:
  note that readTimeout and timeout should put a brake on it but it's not the case

And the command:

expect (.*\s*)*?
send #!/bin/bash

expect (.*\s*)*?

send DATA_DIR=/mnt/c/Users/xxxx

expect (.*\s*)*?

send FILE_NAME=ZQC_SADOFL.txt

expect (.*\s*)*?
send cat ${DATA_DIR}/${FILE_NAME} | sed 's///g' | sed 's/\r$//g' | sed ':a;N;/\n300|/!s/\n/ /;ta;P;D' > ${DATA_DIR}/${FILE_NAME:(0):(-4)}-CLEAN-.txt

expect ^$$


I've tried to use at the end "expectEndsWith ^$$ but it doesn't work giving the error that "

(exception=Script did not fully finish, had: 1 commands left )



Any help or hint will be greatly appreciated.

Best regards,
Alan





  • Suggested Answer

    0  

    Please try to use operation “/Base [1.21.7]/Library/Operations/Remote Command Execution/SSH/v2.0/SSH Command”, and add a “keepalive” input to the operation which sets the time in milliseconds to wait between keep alive packets that are sent to the server.

  • 0 in reply to   

    Hello Saml,


    Thank you for this. It's working as intended now.


    Br,
    Alin