1.

Solve : Rewriting a batch file from an ftp copy to a network file system copy?

Answer»

Hello! I am not good at writing batch files. It's all so Greek to me, so I'm hoping someone can help. I have a batch file that was originally written to ftp files from one server to another. Now it's been decided that ftp is not the mode of transport desired. Instead it's preferred I use nfs. So here's the ftp portion of the batch file:

REM - FTP DATA FILES:
:FTP
REM Generate the FTP script.
ECHO user %USERID% %PASSWD%>%UNLOAD_DIR%\unload_wfm.ftp
ECHO cd stream1>>%UNLOAD_DIR%\unload_wfm.ftp
ECHO lcd %UNLOAD_DIR%>>%UNLOAD_DIR%\unload_wfm.ftp
ECHO mput *_%HH_TIME%.dat>>%UNLOAD_DIR%\unload_wfm.ftp
ECHO quit>>%UNLOAD_DIR%\unload_wfm.ftp

REM FTP DATA FILES (input script: %UNLOAD_DIR%\unload_wfm.ftp)
ftp -i -n -s:%UNLOAD_DIR%\unload_wfm.ftp %IP%>> %LOG_DIR%\%REPORT_FILE%


How do I change it to a regular copy? Thanks in advance. If you need more INFORMATION, let me know. I can POST the whole batch file if necessary.



dFTP is a transfer protocol and NFS is a filesystem protocol. They are 2 totally different things. You can sometimes use FTP over NFS in which case the same code would work.

I think the answer you are looking for is going to depend on the operating system of the computer doing the copying. Please provide more details. What operating SYSTEMS are involved on the computer doing the copy / transfer and each of the servers? Which computers is NFS already installed on? NFS is typically installed by default on Linux servers, but not Windows servers.The copy is across a Windows network, both servers are Windows-based. I was a little confused by the term NFS as I, too, THOUGHT that was indicative of a UNIX server. I think we should forget about the NFS term and just look at this as a straight copy between servers. I WONDERED if this would work:

REM - COPY DATA FILES:
REM Generate the COPY script.
REM CALL %FTP_BIN_DIR%\wfm_ftpinfo.bat
ECHO user xxx xxxxxxxx>%UNLOAD_DIR%\unload_wfm.ftp
ECHO cd stream1>>%UNLOAD_DIR%\unload_wfm.ftp
ECHO copy %UNLOAD_DIR%>>%UNLOAD_DIR%\unload_wfm.ftp

REM COPY DATA FILES (input script: %UNLOAD_DIR%\unload_wfm.ftp)
xcopy %UNLOAD_DIR%\unload_wfm.ftp \\xxxxx\Progra~1\Axxxxt\exxxxf~1\WxxDxxx\Lxxxxx\Sxxxxx1 >> %LOG_DIR%\%REPORT_FILE%


The issue is I have to install it tomorrow and I'd like it to work on the first try. I don't want to have to do editing on the fly because I wouldn't know where to start.

Thanks.



d



Discussion

No Comment Found