Hello,
In our Data Warehouse environment, before our batch SFTP jobs kick off to pull the files from remote servers, I would like to setup a pre-sftp job that would test if all the remote servers from where the files are being pulled, are up and running. If any one of the remote serer is down, then an error needs to be raised.
I was thinking if I can use one of the below commands, but do not know what would be the return code I need to check in case of a successful connection and unsuccessful connection for these commands.
Please advise me of the appropriate commands that I could use in a shell script to handle this. Thank you
Commands:
- sftp <host> OR sftp <username>@<host>
- ping <host>
- telnet <host> <port:22>
- <any other command>?
Regards,
Dippu