Error Catch in FTP Batch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
SteveE
Posts: 2
Joined: 02 Sep 2010 12:24

Error Catch in FTP Batch

#1 Post by SteveE » 02 Sep 2010 14:17

I have a simple batch file that runs 4 functions and sends some files via FTP to our server
1: collects any of file type *.swy from drop point
2: FTP them to Server
3: Copies files *.swy to backup directory
4: Deletes files *.swy from Drop Point

I need to error catch if the files being FTP’d and not, so that they don’t get deleted from the drop point until ftp’d

Here is my batch file: (this runs fine as is just need to capture should Myserver be down etc)

cd \\Test\db\CFS\WWICFPods
ftp -s:\\Test\db\CFS\WWICFPods\Script.txt
copy \\Test\DB\Cfs\WWICFPods\*.swy \\Test\DB\Cfs\WWICFPods\bak
del \\Test\DB\Cfs\WWICFPods\*.swy
y

======================================================================
Here is the FTP Script.txt file

open
Myserver
MyLogon
MyPassword
CD /cluster/cfs/u/cim3/outray/filedrop
PWD
ascii
prompt
mput \\Test\db\CFS\WWICFPods\*.swy
bye

any help / advise appreciated

ghostmachine4
Posts: 319
Joined: 12 May 2006 01:13

Re: Error Catch in FTP Batch

#2 Post by ghostmachine4 » 02 Sep 2010 19:31

Win32 ftp is not really a good ftp client to do automation. Use a good programming language like Perl/Python that have FTP libraries with capabilities for error debugging and trapping. Eg of Perl's Net::FTP

SteveE
Posts: 2
Joined: 02 Sep 2010 12:24

Re: Error Catch in FTP Batch

#3 Post by SteveE » 05 Sep 2010 14:38

Thanks for the advise but I am stuck with the basic cmd FTP tool
if you are saying I have no options in this are then thanks for your time, I will just have to manage without error catching
Steve

ghostmachine4
Posts: 319
Joined: 12 May 2006 01:13

Re: Error Catch in FTP Batch

#4 Post by ghostmachine4 » 05 Sep 2010 18:54

you may want to try the -d switch for debugging.... that's about it i can recommend.

Post Reply