Cannot copy files using mget


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cannot copy files using mget
# 1  
Old 11-26-2009
Cannot copy files using mget

I performed the following operations:
- ftp
- open xxx.xxx.xxx.xxx
- username, password
- dir
200 PORT command succesful
150 Opening ASCII mode data connection for /bin/ls

I see some files and 1 directory

- I digit: mget *
for each file I see:
mget .\nomefile? Y
200 PORT command succesful
125 Data connection open, transfer starting
226 Transfer complete
local: .\nomefile remore: .\nomefile

and so on for all the other files.

When i close ftp, I cannot find the copied files.

Can you help me?
# 2  
Old 11-26-2009
Quote:
Originally Posted by andreac81
I performed the following operations:
- ftp
- open xxx.xxx.xxx.xxx
- username, password
- dir
200 PORT command succesful
150 Opening ASCII mode data connection for /bin/ls

I see some files and 1 directory

- I digit: mget *
for each file I see:
mget .\nomefile? Y
200 PORT command succesful
125 Data connection open, transfer starting
226 Transfer complete
local: .\nomefile remore: .\nomefile

and so on for all the other files.

When i close ftp, I cannot find the copied files.

Can you help me?

Are you sure about the local directory to which ftp is done? Make sure you use the lcd to confirm the local directory
# 3  
Old 11-26-2009
.\nomefile

Is the backslash really part of the name? If what you wrote is what you actually typed
that is probably the reason you cannot see your file.
cd to the directory on the unix box where you were, try:
Code:
ls -la *omefile

the \ character is a special character to the unix shell. Do not use it in filenames.
# 4  
Old 11-26-2009
I only typed: mget *
Then the output is:
mget .\nomefile? Y
200 PORT command succesful
125 Data connection open, transfer starting
226 Transfer complete
local: .\nomefile remore: .\nomefile

So the the \ character is on the output, i didn't type the \ I only typed mget *

Then, to reply to dennis.jacob i tryed to type: mget lcd *
and the result is the same
# 5  
Old 11-26-2009
Further to Jim Mcnamara. The remote filenames appear to be invalid. To work out where they went you need to know the actual filename.
However: This might reveal them.
Code:
ls -la .??*


Can you get a a normal unix directory listing of the files on the remote server? I don't think that the "dir" in ftp is telling the whole story.
e.g. To show funny characters in filenames:

Code:
ls -la directory_name | sed -n l

# 6  
Old 11-26-2009
Yes, using ls -ls i see also files copied by mget, their names is .\filename for example .\current.nas

Why they contains th .\ characters in the name?
# 7  
Old 11-26-2009
I think that the original files on the far server have very strange filenames.
It's actually quite difficult to guess the filename.
You need to find out the actual name of the files and then consider repairing the process which created the files.

A unix filename can contain virtually any character including shell special characters. It is never sensible to have shell special characters in a filename (e.g. backslash, dollar etc.).
Also if you want to transfer a file with ftp protocol the filename rules are much more restrictive than modern unix or Windows.

On a hunch, the files could have been created when someone typed ".\filename" instead of "./filename" in a non-shell context like a program.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

FTP mget will only grab files not folders

Hey All, first post :rolleyes: So I am writting a script to pull down files from an ftp that will be called from a bat file on windows. This seems pretty straight forward, and grabs all of the "files" in the cd location, but I am running into some permission issue that will not allow me to... (1 Reply)
Discussion started by: mpatton
1 Replies

2. UNIX for Dummies Questions & Answers

Copy files from one drive to another, keeping most recently modified files

Hi all, I am a bit of a beginner with shell scripting.. What I want to do is merge two drives, for example moving all data from X to Y. If a file in X doesn't exist in Y, it will be moved there. If a file in X also exists in Y, the most recently modified file will be moved to (or kept) in... (5 Replies)
Discussion started by: apocolapse
5 Replies

3. UNIX for Advanced & Expert Users

Help with get/mget from FTP server with files older than 10 minutes

Hi! I am new to unix and this forum as well.. Can someone please help me : I want to "get/mget" files which are older than 10 minutes from a remote FTP server like "ftp.com". After getting the files to local unix server say "Prod.com" , i need to delete only those files from ftp.com which... (4 Replies)
Discussion started by: SravsJaya
4 Replies

4. Shell Programming and Scripting

Creating a list of files retrieved from MGET

Is there a way to create a txt file with the names of the files I retreive using mget *.file. I want to use this file as input to a delete command. Using HP-UX (3 Replies)
Discussion started by: jagf
3 Replies

5. UNIX for Dummies Questions & Answers

Mget issue: not transferring more than 2 files

I am trying to transfer about 3000 files from a window platfrom to my linux server. the scrip is pretty simple ftp to the source server (windows) cd to source directory lcd to destination directory mget *.jpg what I get in the log file is: mget 07421001.jpg? 200 PORT command successful.... (4 Replies)
Discussion started by: Doveman
4 Replies

6. Solaris

How to safely copy full filesystems with large files (10Gb files)

Hello everyone. Need some help copying a filesystem. The situation is this: I have an oracle DB mounted on /u01 and need to copy it to /u02. /u01 is 500 Gb and /u02 is 300 Gb. The size used on /u01 is 187 Gb. This is running on solaris 9 and both filesystems are UFS. I have tried to do it using:... (14 Replies)
Discussion started by: dragonov7
14 Replies

7. 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

8. Shell Programming and Scripting

shell script - ftp downloading serveral files without mget

Hello guys, i'm searching for a solution how to download all files from root-directory of an ftp-server through an ftp proxy getting through the ftp proxy and download one file with get ist no problem, but mget * does nothing! ftp -n -i -v <<EOF open proxyHost proxyPort user... (19 Replies)
Discussion started by: macProgger23
19 Replies

9. Shell Programming and Scripting

mget * (obtein files from current directory but not the files form sub-directories)

Hello, Using the instruction mget (within ftp) and with "Interactive mode off", I want to get all files from directory (DirAA), but not the files in sub-directories. The files names don't follow any defined rule, so they can be just letters without (.) period Directory structure example: ... (0 Replies)
Discussion started by: Peter321
0 Replies

10. UNIX for Dummies Questions & Answers

Where are "get/mget" files stored?

From telnet, I ftped into a remote server. When using mget or get, where are the downloaded files stored? (3 Replies)
Discussion started by: yongho
3 Replies
Login or Register to Ask a Question