The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> System Administration
> FTP Help
|
Downloading file from UNIX box to Windows box
Discuss Downloading file from UNIX box to Windows box in the FTP Help forum on Dev Shed. Downloading file from UNIX box to Windows box FTP Help forum discussing FTP practices, tips and solutions for problems with FTP on multiple platforms. File Transfer Protocol (FTP) was designed specifically for transferring files from one machine to another.
|
|
 |
|
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

June 13th, 2012, 02:47 PM
|
|
Registered User
|
|
Join Date: Jun 2012
Posts: 9
Time spent in forums: 1 h 23 m 20 sec
Reputation Power: 0
|
|
|
Downloading file from UNIX box to Windows box
Hello,
I have to download file from a unix ftp server to a windows server. The issue is the unix box has multiple files and the filename are the same. When I do an mget the the files overwrite each other and i only get the last one. I have to download these files using a command line batch file. I have tried getting a list of the files and created a batch file with multiple get where it saves the files with a seq number. the issue here is it grabs the first file each time. The bad thing is i can not delete or rename the files on the unix box. Ant ideas how to do this?
Thanks
Matt
|

June 13th, 2012, 03:17 PM
|
 |
Providing fuel for space ships
|
|
Join Date: Mar 2004
Location: nr Edinburgh, Scotland
|
|
|
I don't quite understand what you mean - Unix doesn't allow for two file names to have exactly the same name in the same folder. Are these files in multiple folders ?
__________________
The No Ma'am commandments:
1.) It is O.K. to call hooters 'knockers' and sometimes snack trays
2.) It is wrong to be French
3.) It is O.K. to put all bad people in a giant meat grinder
4.) Lawyers, see rule 3
5.) It is O.K. to drive a gas guzzler if it helps you get babes
6.) Everyone should car pool but me
7.) Bring back the word 'stewardesses'
8.) Synchronized swimming is not a sport
9.) Mud wrestling is a sport
|

June 14th, 2012, 09:15 AM
|
|
Registered User
|
|
Join Date: Jun 2012
Posts: 9
Time spent in forums: 1 h 23 m 20 sec
Reputation Power: 0
|
|
|
Thanks for the reply. I know it sounds odd but it is true. I am trying to upload a screen shot of the site yet I can not get the image on this site.
|

June 14th, 2012, 10:03 AM
|
|
Registered User
|
|
Join Date: Jun 2012
Posts: 9
Time spent in forums: 1 h 23 m 20 sec
Reputation Power: 0
|
|
|
in my command line window I copied the listing of the file on the UNIX Box:
listing remote directory /xxxxx/downloaded
dr-xr-xr-x 1 0 0 4096 Jun 14 10:59 ..
-r--r--r-- 1 0 0 154 Jun 14 10:46 BCTA1.out
-r--r--r-- 1 0 0 288 Jun 14 09:45 BC999.out
-r--r--r-- 1 0 0 154 Jun 13 15:28 BCTA1.out
-r--r--r-- 1 0 0 154 Jun 13 15:28 BCTA1.out
-r--r--r-- 1 0 0 288 Jun 13 15:28 BC999.out
-r--r--r-- 1 0 0 288 Jun 13 15:28 BC999.out
As you can see there are multiple BCTA1.out and BC999.out files in the same folder.
|

June 17th, 2012, 05:08 AM
|
 |
Providing fuel for space ships
|
|
Join Date: Mar 2004
Location: nr Edinburgh, Scotland
|
|
Ahhhh, I see what you mean now. It looks like that the duplicate files must have a non-printing character on some of them. Try using This should show you the file listing but also show any escape/control character contained the filename.
If this is the case, I think you'll need to rename the files on the remote server before you can ftp them down to your windows box.
|

June 18th, 2012, 07:08 AM
|
|
Registered User
|
|
Join Date: Jun 2012
Posts: 9
Time spent in forums: 1 h 23 m 20 sec
Reputation Power: 0
|
|
|
Thank for the reply. When i type ls -lb i get this message:
sftp> ls -lb
Warning: Invalid command parameter: -lb.
Any other ideas to see the control characters?
|

June 18th, 2012, 09:24 AM
|
 |
They're coming to take me away
|
|
Join Date: Jan 2005
Location: Florida
|
|
Quote: | Originally Posted by matta25 Thank for the reply. When i type ls -lb i get this message:
sftp> ls -lb
Warning: Invalid command parameter: -lb.
Any other ideas to see the control characters? |
Try:
ls -la
__________________
"I don't need to get a life. I'm a gamer. I have lots of lives!"
|

June 18th, 2012, 10:25 AM
|
|
Registered User
|
|
Join Date: Jun 2012
Posts: 9
Time spent in forums: 1 h 23 m 20 sec
Reputation Power: 0
|
|
|
Same thing:
sftp> ls
listing remote directory /XXXXXXXX/downloaded
dr-xr-xr-x 1 0 0 4096 Jun 18 11:24 ..
-r--r--r-- 1 0 0 9646 Jun 18 10:01 BCAccNotAccRep.out
-r--r--r-- 1 0 0 288 Jun 18 09:59 BC999.out
-r--r--r-- 1 0 0 154 Jun 18 09:59 BCTA1.out
-r--r--r-- 1 0 0 288 Jun 18 09:50 BC999.out
-r--r--r-- 1 0 0 154 Jun 18 09:50 BCTA1.out
-r--r--r-- 1 0 0 52962 Jun 18 09:50 BCAccNotAccRep.out
-r--r--r-- 1 0 0 52962 Jun 15 07:17 BCAccNotAccRep.out
-r--r--r-- 1 0 0 154 Jun 14 10:46 BCTA1.out
-r--r--r-- 1 0 0 288 Jun 14 09:45 BC999.out
-r--r--r-- 1 0 0 154 Jun 13 15:28 BCTA1.out
-r--r--r-- 1 0 0 288 Jun 13 15:28 BC999.out
sftp> ls -la
Warning: Invalid command parameter: -la.
sftp>
|

June 18th, 2012, 10:33 AM
|
 |
They're coming to take me away
|
|
Join Date: Jan 2005
Location: Florida
|
|
|
When you are trying to use -la, are you logged in to the FTP server, or the actual unix server?
|

June 18th, 2012, 10:53 AM
|
|
Registered User
|
|
Join Date: Jun 2012
Posts: 9
Time spent in forums: 1 h 23 m 20 sec
Reputation Power: 0
|
|
|
The FTP server. that is the only way i have access to this unix box.
|

June 18th, 2012, 11:06 AM
|
 |
They're coming to take me away
|
|
Join Date: Jan 2005
Location: Florida
|
|
Quote: | Originally Posted by matta25 The FTP server. that is the only way i have access to this unix box. |
I agree with aitken regarding the non-printing character. A lot of times this is an accidental creation. Without access to the server, you will be limited.
Are you sure you need all files of the same name?
|

June 18th, 2012, 12:30 PM
|
|
Registered User
|
|
Join Date: Jun 2012
Posts: 9
Time spent in forums: 1 h 23 m 20 sec
Reputation Power: 0
|
|
|
There are time in one day we will send multiple file (we end them with different name) and payer that process the files create a responses for each file but they always created them with the same filename (plus control characters). I have talked to them about this and they say that is how there system works. They say to have to download one file and rename it on the windows side. then download the next one. This issue is I can not delete or rename the files and when I download one file and rename is on my side I download the next one with the same filename and the batch file grabs the first one again and again. I guess i will have to manually download these responses. Thanks for all your help!!!!
|

June 18th, 2012, 04:05 PM
|
 |
Providing fuel for space ships
|
|
Join Date: Mar 2004
Location: nr Edinburgh, Scotland
|
|
|
How about loading up a linux VM on your Windows server and ftp'ing the files down onto that Linux box ? Haven't tried this personally but it *may* just download the files with the escape character in the filename and then you should be able to rename the offending files.
I am puzzled though as to why they would purposely include control characters in a filename, strange!
|

June 19th, 2012, 06:40 AM
|
|
Registered User
|
|
Join Date: Jun 2012
Posts: 9
Time spent in forums: 1 h 23 m 20 sec
Reputation Power: 0
|
|
|
Thank you all for your help. I think my co-worker has a VM of a linux box. I will have to type this. This payer know this is an issue yet they will not do anything to fix it.
|

June 26th, 2012, 09:03 AM
|
|
Registered User
|
|
Join Date: Jun 2012
Posts: 9
Time spent in forums: 1 h 23 m 20 sec
Reputation Power: 0
|
|
|
Hello All,
I have created a VM on a linux box and have connected to the SFTP site. When I type "LS" or "LS -l" I still get the file listing with no control characters. Any Ideas?
sftp> ls -l
-r--r--r-- 1 0 0 16016 Jun 26 08:16 CAccNotAccRep.out
-r--r--r-- 1 0 0 16016 Jun 25 19:03 CAccNotAccRep.out
dr-xr-xr-x 2 0 0 4096 Jun 26 08:58 canceled
dr-xr-xr-x 2 0 0 4096 Jun 26 08:58 downloaded
sftp>
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|