Re: FTP Transfer



"Jorge Silva" <jorgesilva_pt@xxxxxxxxxxx> wrote in message
news:evcW03k7IHA.2260@xxxxxxxxxxxxxxxxxxxxxxx
Hi Everyone,

I've a bach file tha loads a script (txt file) and transfers the files
that
are inside that txt file then move these files to a backup directory.
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
of
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".


.



Relevant Pages

  • Re: FTP Quoted Filenames
    ... I'm attempting to GET a file that has spaces in the filename, ... ftp> get "TAPEMANAGER GUI VER. ... 501-Error in RETR command parameters; Scanning TAPEMANAGER GUI VER.. ...
    (microsoft.public.inetserver.iis.ftp)
  • edtFTPj/PRO 1.4.0 released (SFTP and FTPS client)
    ... release of edtFTPj/PRO 1.4.0, which is an enhanced version of edtFTPj ... and SFTP. ... FTPTransferCancelledException now thrown for FTP/S transfers if the ... filename wildcards. ...
    (comp.lang.java.announce)
  • Re: scheduling ftp
    ... Due to the variable limitations with ftp it may be easier for me to copy all ... I used the knowledge base article to create an ftp script called test.scr ... command prompt. ... the variable filename and then call on the ftp script to use the variable ...
    (microsoft.public.windowsxp.general)
  • Re: [SLE] ftp
    ... > Say i am using ftp from the command line. ... That being the case and assuming the ftp server is setup to accept things from ... filename as an argument? ...
    (SuSE)
  • General FTP command question - dir/ls
    ... When I do a dir or ls command the filename is case sensitive. ... Is there any way I can tell ftp to made the command not case sensitive? ... Don't worry and shout ...
    (microsoft.public.inetserver.iis.ftp)

Loading