FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 13th, 2012, 02:47 PM
matta25 matta25 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 9 matta25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #2  
Old June 13th, 2012, 03:17 PM
aitken325i's Avatar
aitken325i aitken325i is offline
Providing fuel for space ships
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Mar 2004
Location: nr Edinburgh, Scotland
Posts: 14,360 aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)  Folding Points: 10110 Folding Title: Novice Folder
Time spent in forums: 6 Months 1 Day 12 h 43 m 17 sec
Reputation Power: 3777
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

Reply With Quote
  #3  
Old June 14th, 2012, 09:15 AM
matta25 matta25 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 9 matta25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #4  
Old June 14th, 2012, 10:03 AM
matta25 matta25 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 9 matta25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #5  
Old June 17th, 2012, 05:08 AM
aitken325i's Avatar
aitken325i aitken325i is offline
Providing fuel for space ships
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Mar 2004
Location: nr Edinburgh, Scotland
Posts: 14,360 aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)  Folding Points: 10110 Folding Title: Novice Folder
Time spent in forums: 6 Months 1 Day 12 h 43 m 17 sec
Reputation Power: 3777
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
Code:
ls -lb
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.

Reply With Quote
  #6  
Old June 18th, 2012, 07:08 AM
matta25 matta25 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 9 matta25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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?

Reply With Quote
  #7  
Old June 18th, 2012, 09:24 AM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jan 2005
Location: Florida
Posts: 5,091 hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 3 Months 2 Weeks 6 Days 21 h 54 m 38 sec
Reputation Power: 5048
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!"

Reply With Quote
  #8  
Old June 18th, 2012, 10:25 AM
matta25 matta25 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 9 matta25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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>

Reply With Quote
  #9  
Old June 18th, 2012, 10:33 AM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jan 2005
Location: Florida
Posts: 5,091 hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 3 Months 2 Weeks 6 Days 21 h 54 m 38 sec
Reputation Power: 5048
When you are trying to use -la, are you logged in to the FTP server, or the actual unix server?

Reply With Quote
  #10  
Old June 18th, 2012, 10:53 AM
matta25 matta25 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 9 matta25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #11  
Old June 18th, 2012, 11:06 AM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jan 2005
Location: Florida
Posts: 5,091 hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)hiker User rank is General 61st Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 3 Months 2 Weeks 6 Days 21 h 54 m 38 sec
Reputation Power: 5048
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?

Reply With Quote
  #12  
Old June 18th, 2012, 12:30 PM
matta25 matta25 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 9 matta25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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!!!!

Reply With Quote
  #13  
Old June 18th, 2012, 04:05 PM
aitken325i's Avatar
aitken325i aitken325i is offline
Providing fuel for space ships
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Mar 2004
Location: nr Edinburgh, Scotland
Posts: 14,360 aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)aitken325i User rank is General 42nd Grade (Above 100000 Reputation Level)  Folding Points: 10110 Folding Title: Novice Folder
Time spent in forums: 6 Months 1 Day 12 h 43 m 17 sec
Reputation Power: 3777
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!

Reply With Quote
  #14  
Old June 19th, 2012, 06:40 AM
matta25 matta25 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 9 matta25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #15  
Old June 26th, 2012, 09:03 AM
matta25 matta25 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 9 matta25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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>

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > Downloading file from UNIX box to Windows box

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap