Link to home
Start Free TrialLog in
Avatar of ashok p
ashok p

asked on

Reg. FTP connection by CMD

Hi,
I need one help reg. FTP through CMD.

I have scheduled one task to FTP the files to the remote server for every 10 minutes daily.
Its working fine.
But sometime the connection from remote server is get lost. Because of this my files are not transferring at that time.
Can anyone help , how to track and get into my knowledge whenever the FTP connection lost from the remote server. (Example : like getting email whenever connection , etc.,)

Kindly guide me regarding this.
Avatar of Sean Stuber
Sean Stuber

are you looking to get rid of windows cmd and use oracle some how?

you set the topic area to Oracle, but it doesn't appear to be an oracle question
Avatar of ashok p

ASKER

No
Avatar of ashok p

ASKER

I want to track my FTP connectivity to the remote server.
I see you've changed the topic area, I'm not sure Exchange is the best one either
Avatar of ashok p

ASKER

The topic which is in the list its not suit for my FTP question. thats why i given the general topic.

Can you able to help me reg. this prob?
This can only work if you log what you do. Then after the logging you still need to parse the log file itself and interpret it correctly, then follow up on the results (retry or alert)
Maybe you're better off with a self-written program instead? Or a very advanced FTP suite (probably paid), that has options to retry, or has alerting options.
Avatar of ashok p

ASKER

Thanks . i am already generating the log file for FTP process everytime. Is there way to use of it to get alert whenever connection got failure
Have another script running, like a few minutes after the FTP job.

Reads latest log file.
Check for errors, by status codes, or error messages.
Action/Alert (Telegram? Email? Retry?)

Is VBScript an option? Attach sample log files (both successful ones as well as error ones)?
Avatar of ashok p

ASKER

Hi,
I have attached the two log files. Failure and success.
FAILURE.log
SUCCESS.log
This is the most basic steps to check for errors (in VBScript):

CONST ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set Input = objFSO.OpenTextFile("testfail.txt", ForReading)
If instr(Input.ReadAll, "Not connected.") then
	msgbox "BAd stuff!!"
end if
Input.Close

Open in new window


Obviously, needs to implement getting the newest log file(s) and action/alert code
Avatar of ashok p

ASKER

Thanks for your feedbaCK.
One more constraint, i will not check the PC continuously.
I am automated this FTP in a daily basis. so shall i get any alert like email to me like that.
Is it possible?
Depends. The script can be automated (as I said, schedule it a few minutes after the FTP jobs), and email is an option to be alerted (needs a working SMTP server, that either accepts the mail directly, or can be used as a relay). Personally, I use Telegram to get push alerts on my phone. Also, do you really need it? Because it seems the next run should solve the error in the previous run? Will also run more smoothly if the firewall on the other side puts your IP address in the white list. Because it seems the other side is blocking your connection now and then.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.