Edgars
Edgars

Reputation: 1

How to check FTP availability in batch file to stop running script

I need to create a validation function in batch file to check for availability of FTP server because I'm executing put command then deleting my locally stored files. The Problem is if i don't check if FTP server is up, files are not put to server but locally deleted.

Upvotes: 0

Views: 282

Answers (1)

Simon Berka
Simon Berka

Reputation: 378

What about simply use "ping" and than use some condition with "$?" > when $? returns "2" (I think) the ftp server is down

Upvotes: 1

Related Questions