Mget with SFTP is not working

hi Team,

I am connecting from one (A) linux server to another(C)/any linux server by sftp
on A linux server:

sftp userid@C
password:
mget is Not working fine

I am using mget to pull the files. it shows mget as invalid command.

But from (B) Linux server to (C) /to Any server Linux server. mget is working fine.
on B Linux Server:

on B linux server:

sftp userid@C
password:
mget is working fine

Please help what could be the issue?

In what way is mget failing?

Please show us any diagnostics produced (exactly as they appear and placed in CODE tags).

What files are present in that directory on those two servers?

Which releases of which distributions of Linux are on the three servers?

Is the same version of sftp installed on all three servers? If not, what are the versions on the three servers involved?

Hi Don,

Thank you for the prompt response on this.
Attached the screenshot.

Normal text files.

Server A mget is not working:
Red Hat Enterprise Linux Server release 5.6 (Tikanga)

Server B mget is working:
Red Hat Enterprise Linux Server release 5.11 (Tikanga)

i used the command: telnet localhost 22
Server A mget is not working
SSH-2.0-OpenSSH_5.5

Server B mget is working:
SSH-2.0-OpenSSH_4.3

Regards,
Babu

You need to give mget something to work with. Just 'mget' by itself is bad syntax.

No , its not invalid without parameter. Already tried by giving file name.

it should display like this without passing parameter:

sftp> mget
You must specify at least one path after a mget command.

Regards,

Running my sftp (OpenSSH_7.5p1 Ubuntu-10ubuntu0.1, OpenSSL 1.0.2g 1 Mar 2016), for an mget without a path I receive

sftp> mget
You must specify at least one path after a mget command.

It seems to recognise mget although it's not mentioned in man sftp , mayhap for compatibility reasons. For get it says:

So get may have taken the place of mget .
What does your man sftp say about the availability of mget ?

Try get with wildcards instead.

And what happens when you DO give at least one path after mget command?

man sftp doesnt contain mget listed in it. yes i can use 'get' . only concerns is it overrides the the files. mget doesnot overrides the files. is it true ?

Regards,

---------- Post updated at 12:16 AM ---------- Previous update was at 12:15 AM ----------

it says invalid command

It is really strange for mget to not work. Check for typos and carriage returns in your script file

Hi ,

code: mget file_name

This is also showing invalid command

Regards,
Babu

---------- Post updated at 10:44 AM ---------- Previous update was at 10:43 AM ----------

Hi ,

get( to multiple files) is working fine. But only concern is it will override the files. mget doesnot.

Regards,
Babu

Override what? I don't understand what you're expecting.

Overwrite...?

Not sure mget doesn't...

overriding files which already exists in destination.

example: doing mget from A to B.
if file exists in B already mget will override the files.

---------- Post updated at 04:55 PM ---------- Previous update was at 04:55 PM ----------

overriding files which already exists in destination.

example: doing mget from A to B.
if file exists in B already mget will override the files.

Which is contradictory to what you said in post#10 and previous.

Hi, johnsnow.

By override, I assume what is meant is over-write -- in other words, destroying an existing file with an incoming file from sftp .

I haven't verified that that is the actual behavior, but I saw an option, -a , that may avoid such destruction, but it looks to be intended to be used for resume.

One alternative is rsync . I think that allows far more control over what may get deleted, destroyed, etc. As usual, before putting it into production, reading the man page and experimenting are the best path to success.

Good luck ... cheers, drl

Hi Rudi,

It's not contradictory. Mget is still not working .
I just explained about what I heard from my friend. Mget overrides the files as explained previously. How to check the post number 10.

Regards ,