0

I am new to using these sftp programs to get files from a server so understand that I might be very ignorant to a lot of things. With that being said:

I am using windows command line to run psftp.exe like so:

psftp.exe hostname@server -i "myprivatekey.ppk"

the prompt takes me successfully to the server. From here I navigate to the directory I want. I use "ls" command to see all files under the directory. I see my file which is some tar file that is in the format "somestuff.DSD.tar.somenumber" I type: get somestuff.DSD.tar.somenumber

The prompt then tells me: /somedirectory/somestuff.DSD.tar.somenumber:open for read: no such file or directory

What is the problem here? why does it not see the file? is it the .tar file with the extention of somenumber after tar ? I am not sure what a tar file is I believe some zipped folder that stores multiple files.

Thank you for your time and looking into this issue!

Darryl Lobo
  • 155
  • 3
  • 18

1 Answers1

0

The prompt then tells me: /somedirectory/somestuff.DSD.tar.somenumber:open for read: no such file or directory

At a guess you either mistyped the file name - or psftp is not in the right directory to get the file.

does ls *.tar.* list the file your need to get?

Tar files are just archive files - and in Unix operating systems the file extension does not determine the file type. By default tar files are not compressed zipped but they can be compressed so save space.

hth

fcbsd
  • 180
  • 6
  • 12
  • That is helpful about the unix file extentions, thanks! when i do `ls *.tar.*` i do see my file. I also used get using somestuff* which would only pick out that file and nothing else. I did this incase I had a typo. – Darryl Lobo Oct 27 '17 at 15:25
  • Was the error message still: open for read: no such file or directory? as my other guess would be file permissions - but the error message then is usually: open for read: permission denied – fcbsd Oct 27 '17 at 15:52
  • The other thing to check is wether when you type `lpwd` it shows the a directory on your windows machine that you can write too - otherwise psftp will fail. To change the local directory type `lcd /path/to/direcory`. Can you get any of the files in the directory? `mget *` will get all files on the remote server. – fcbsd Oct 27 '17 at 16:47
  • thanks fcbsd it worked now. I tried all your suggestions but it seemed to work after I used `mget file_name_prefix.*` Could it be tar files are seen as multiple files hence we have to use mget instead of the regular get? – Darryl Lobo Oct 27 '17 at 17:59