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
Error Catch in FTP Batch
Moderator: DosItHelp
-
- Posts: 319
- Joined: 12 May 2006 01:13
Re: Error Catch in FTP Batch
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
Re: Error Catch in FTP Batch
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
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
-
- Posts: 319
- Joined: 12 May 2006 01:13
Re: Error Catch in FTP Batch
you may want to try the -d switch for debugging.... that's about it i can recommend.