Re: FTP Transfer
- From: "McKirahan" <News@xxxxxxxxxxxxx>
- Date: Fri, 25 Jul 2008 07:44:43 -0500
"Jorge Silva" <jorgesilva_pt@xxxxxxxxxxx> wrote in message
news:evcW03k7IHA.2260@xxxxxxxxxxxxxxxxxxxxxxx
Hi Everyone,that
I've a bach file tha loads a script (txt file) and transfers the files
are inside that txt file then move these files to a backup directory.of
My problem is that in case of connection failure or any other error the
files are still moved. Any chance how to control this?
the command inside the bachfile is (the 000.000.000.000 represents the IP
the ftp server):
ftp -s:myfile.txt 000.000.000.000>> ftplog.txt
MyFile.txt has inside:
<---------------->
ftpusername
ftppassword
bin
prompt
cd /in
lcd "c:\path to the files"
put FileNAme000
!move FileNAme000 ..\BackupDirectory
put FileNAme001
!move FileNAme001 ..\BackupDirectory
put FileNAme002
!move FileNAme002 ..\BackupDirectory
quit
<---------------->
I need something inside myfile.txt between "put FileNAme" and "!move
FileNAme ..\BackupDirectory" that IN CASE of different from "Transfer
complete" it aborts the action for "!move FileNAme ..\BackupDirectory".
One approach would be to add the "dir" command just before the "quit"
command then examine the log file and compare files sizes or date stamps.
sLOG = objFSO.OpenTextFile("ftplog.txt",1).ReadAll()
If InStr(sLOG,"cannot log in") > 0 Then
WScript.Echo "FTP login failed!"
Else
' determine if files were uploaded successfully worked here
End If
Of course, this would mean that you'd have to do the "!move" commands
either in another execution of ftp or outside of ftp using FSO in the
"Else".
.
- Follow-Ups:
- Re: FTP Transfer
- From: Jorge Silva
- Re: FTP Transfer
- References:
- FTP Transfer
- From: Jorge Silva
- FTP Transfer
- Prev by Date: FTP Transfer
- Next by Date: Re: FTP Transfer
- Previous by thread: FTP Transfer
- Next by thread: Re: FTP Transfer
- Index(es):
Relevant Pages
|
Loading