MGET Problem


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers MGET Problem
# 1  
Old 10-25-2010
MGET Problem

Hello friends..

I'm new here ate the forum. I came across with it when trying to find a solution for a problem I have and I hope you can help me.

I'm an Abap programmer, and I have to make a program in ABAP to copy files from a server to the local computer defined path using FTP commands.

I was looking at these commands and I sucessfuly managed to copy ONE file from the server (FTP) to the local machine using:

Code:
get get <source_filename> <destination_path_&_filename>

But as I want to copy several files, I tried the following:

Code:
mget * <destination_path>

the execution says that all went well as u can see below

Code:
mget * d:\RJM\                                                               
200 PORT command successful                                                  
150 Opening ASCII mode data connection for 1_NG_NG20100101.dat (2323 bytes)  
226 Transfer complete                                                        
2323 bytes received in 0.00 seconds (2.27 Kbytes/s)                          
200 PORT command successful                                                  
150 Opening BINARY mode data connection for 5_NG_NG20100713.dat (7665 bytes) 
226 Transfer complete                                                        
7665 bytes received in 0.01 seconds (499.02 Kbytes/s)                        
200 PORT command successful                                                  
150 Opening BINARY mode data connection for 5_NG_SOCGL.dat (7665 bytes)      
226 Transfer complete                                                        
7665 bytes received in 0.00 seconds (7.49 Kbytes/s)                          
200 PORT command successful                                                  
150 Opening BINARY mode data connection for 6_NG_NG20100713.dat (8295 bytes) 
226 Transfer complete                                                        
8295 bytes received in 0.17 seconds (47.10 Kbytes/s)

but when I go to the destination path, there are no files there...

can anyone help me please?

Best regards,
Bleeding_me
# 2  
Old 10-25-2010
Hi,

I think the files were transfered to your current directory. Your desination path was considered to be a file to transfer. The easiest solution would be to change to the local destination directory and then get the files:
Code:
lcd d:\RJM
mget *

Stefan
# 3  
Old 10-25-2010
Quote:
Originally Posted by cero
Hi,

I think the files were transfered to your current directory. Your desination path was considered to be a file to transfer. The easiest solution would be to change to the local destination directory and then get the files:
Code:
lcd d:\RJM
mget *

Stefan
Thanx a lot cero, it worked like a charm Smilie...now I can start programing the rest of the code Smilie


Now if I may, i have another question with another command...the MPUT.

i tried to put 2 files, that I have in D:\RJM, into the FTP...it copies the files and the files are there but instead of being with the name ABC.dat (for example) they stay with the name D:\RJM\ABC.dat .... any way to get around this ? (i'm sorry for these questions but I'm a noob in FTP )...

Best regards,
Bleeding_me
# 4  
Old 10-26-2010
PUT, or MPUT

I think that the problem here is if you fully name the source file, then that is what the target will be called, from the directory you are connected to. A similar solution to the previous post is to make your local current directory correct first:-
Code:
lcd d:\RJM
mput *

An alternate is to fully specify the files
Code:
put d:\RJM\file1 file1
put d:\RJM\file2 file2

... but obviously that is more cumbersome.



I hope that this helps.Smilie


Robin

Last edited by rbatte1; 10-27-2010 at 05:58 AM.. Reason: Adding code tags (as I have been chastised)
# 5  
Old 10-26-2010
Quote:
Originally Posted by rbatte1
I think that the problem here is if you fully name the source file, then that is what the target will be called, from the directory you are connected to. A similar solution to the previous post is to make your local current directory correct first:-
lcd d:\RJM
mput *
An alternate is to fully specify the files
put d:\RJM\file1 file1
put d:\RJM\file2 file2
... but obviously that is more cumbersome.



I hope that this helps.Smilie


Robin
Thanx rbatte1 I'll try that one.

Bleeding_me
# 6  
Old 10-27-2010
What Operating System is the computer on which you are typing the "ftp" commands.
What Operating System is the other computer.

(I suspect that you may be using MSDOS filenames on a unix computer).
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Solved] Prompt problem while using mget to ftp

I am writing a scritp in which first step is to get some files from a server. I am using mget to do that. here is my FTP code ... HOST="XXX.XXX.com" 28 ftp -inv $HOST <<END &> $FTP_LOG 29 quote USER $USER 30 quote PASS $PASWD 31 cd log 32 prompt off 33 binary 34 mget... (0 Replies)
Discussion started by: shashidhar
0 Replies

2. UNIX for Dummies Questions & Answers

Strange mget problem

Hi! I'm a bit of a unix n00b so be gentle! I need to use ftp to download some files. I have the ftp running in a shell script which had been working perfectly last week. I downloaded around 400 files before it broke on friday. Now whenever I try to run the script, it starts to download... (3 Replies)
Discussion started by: johnnybongo
3 Replies

3. UNIX for Dummies Questions & Answers

mget help

Hi I'm trying to get all files from a directory with a script. So i'm gone paste my script here: cd /var/www/match_demos/speedgaming/ lftp -u Gudfaren,xxxxx ftp.speedgaming.pro -e cd 89.221.243.11_27500 -e mget *.dem exit when i run that i get: "File name missed. Try `help mget' for more... (2 Replies)
Discussion started by: vYN
2 Replies

4. UNIX for Dummies Questions & Answers

If then else in with mget command

Hi Friends, I need to use if then else logic with the mget command.I need to check if {JOURNAL_CODE}*_1_Audit*.txt exists then download it (using mget)and if not then leave it.Same for the {JOURNAL_CODE}*_2_Audit*.txt file.Can you please tell me how can i achive that? sftp -b -... (3 Replies)
Discussion started by: Param0073
3 Replies

5. Shell Programming and Scripting

problem with ftp mget

Hi I am trying to ftp all the files from a directory in server2 to server1 (both unix) The below code is in server1 ftpfile=/home/anitha/ftptxt echo cd mydir >>$ftpfile echo mget *.* >>$ftpfile cat $ftpfile | ftp -i server2 mydir is a directory in server2 and there are some test files in... (4 Replies)
Discussion started by: anijan
4 Replies

6. UNIX for Dummies Questions & Answers

mget new files only

Hi all, I am currently in the process of setting up an FTP server with limited knowledge :p. I have run into an issue that i need some help with. Basically i want to be able to download files off another remote server twice a day every day but i want to make sure it only downloads new... (1 Reply)
Discussion started by: mokachoka
1 Replies

7. Shell Programming and Scripting

mget command

Hi All, I am using mget (mget server.*) through ftp... ... i dont want to overwrite the files in my localmachine if it is already exists... is it possible through ftp ?? any other optios also mos t welcome Thnks in advance (4 Replies)
Discussion started by: scorpio
4 Replies

8. UNIX for Dummies Questions & Answers

mget and mput...

hello, i was interested in knowing if you can mget or mput a sequence of files: example- say i have a dir with 1000 files with the same extension e.g. *.sgi, is there a way to mget only the last 200 files? i would assume that there is a flag i would use, or something like: mget... (14 Replies)
Discussion started by: yoyomamma
14 Replies

9. UNIX for Dummies Questions & Answers

mget

hi, i want to mget a directory. how to specify the flag that i dont want the system to prompt me? thanks (2 Replies)
Discussion started by: yls177
2 Replies

10. UNIX for Dummies Questions & Answers

mget question

Basically, I like to know how "mget" command work in terms of data/control channels and in terms of request-respond dialogue. Also, when I try the command as an example below, is it true than for each file to be transferred, there is a new connection establish? (ie. transferred one file,... (5 Replies)
Discussion started by: ho_k
5 Replies
Login or Register to Ask a Question

Featured Tech Videos