Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    9
    Rep 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
  2. #2
  3. Providing fuel for space ships
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2004
    Location
    nr Edinburgh, Scotland
    Posts
    14,382
    Rep Power
    3848
    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
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    9
    Rep 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.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    9
    Rep 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.
  8. #5
  9. Providing fuel for space ships
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2004
    Location
    nr Edinburgh, Scotland
    Posts
    14,382
    Rep Power
    3848
    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.
    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
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    9
    Rep 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?
  12. #7
  13. They're coming to take me away

    Join Date
    Jan 2005
    Location
    Florida
    Posts
    5,103
    Rep Power
    5049
    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!"
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    9
    Rep 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>
  16. #9
  17. They're coming to take me away

    Join Date
    Jan 2005
    Location
    Florida
    Posts
    5,103
    Rep Power
    5049
    When you are trying to use -la, are you logged in to the FTP server, or the actual unix server?
    "I don't need to get a life. I'm a gamer. I have lots of lives!"
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    9
    Rep Power
    0
    The FTP server. that is the only way i have access to this unix box.
  20. #11
  21. They're coming to take me away

    Join Date
    Jan 2005
    Location
    Florida
    Posts
    5,103
    Rep Power
    5049
    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?
    "I don't need to get a life. I'm a gamer. I have lots of lives!"
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    9
    Rep 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!!!!
  24. #13
  25. Providing fuel for space ships
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2004
    Location
    nr Edinburgh, Scotland
    Posts
    14,382
    Rep Power
    3848
    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!
    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
  26. #14
  27. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    9
    Rep 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.
  28. #15
  29. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    9
    Rep 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>
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo