Right now: Live recording of the Tech Support Guy Show!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express php pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
DOS/PDA/Other
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > DOS/PDA/Other >
Rewriting a batch file from an ftp copy to a network file system copy


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
dsmack's Avatar
Computer Specs
Junior Member with 3 posts.
 
Join Date: Jun 2007
Experience: used to be technical, not so much so now
12-Jun-2007, 04:50 PM #1
Rewriting a batch file from an ftp copy to a network file system copy
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.



d
Squashman's Avatar
Distinguished Member with 12,525 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
13-Jun-2007, 12:00 AM #2
Are you mapping a Drive letter to the share?
dsmack's Avatar
Computer Specs
Junior Member with 3 posts.
 
Join Date: Jun 2007
Experience: used to be technical, not so much so now
13-Jun-2007, 09:28 AM #3
No drive letter mapping.

The copy is across a Windows network, both servers are Windows-based. I was a little confused by the term NFS as I 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.
ChuckE's Avatar
Senior Member with 1,854 posts.
 
Join Date: Aug 2004
Location: Redondo Beach, CA
Experience: Advanced
13-Jun-2007, 04:43 PM #4
There is no reason you can't map a drive located on another computer.
Let's say you decide on a drive letter M

Then just:
XCOPY M:wherever\unload_wfm.ftp C:\wherever

I assume it is just one file you want to copy over. It is one line. Whatever the directory paths are, and I am not trying to guess your paths here.

Note: If any of the path or file names have spaces, you just enclose the entire path parameter in quotes, such as:
XCOPY "m:\one place\Tools\unload_wfm.ftp" "c:\Somewhere else\blah blah\xxx"
And, by the way, it doesn't hurt to always use quotes, always. It makes it easier to edit later, since you always have the quotes to edit inside of, regardless if spaces are there or not.
__________________
Rehab is for quitters.
dsmack's Avatar
Computer Specs
Junior Member with 3 posts.
 
Join Date: Jun 2007
Experience: used to be technical, not so much so now
17-Jun-2007, 10:42 AM #5
Thank you for your help
Actually, this project is with the federal government, and more specifically for the air force, so mapping a drive is not that easy! The basic batch file worked fine with xcopy and I think we have the destination drive problem straightened out. Just need final approval from the Secretary of Defense!

Thanks again for the help.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:58 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.