Mget with SFTP is not working


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Mget with SFTP is not working
# 1  
Old 01-23-2018
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:
Code:
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:
Code:
sftp userid@C
password:
mget is working fine

Please help what could be the issue?

Last edited by Don Cragun; 01-23-2018 at 11:23 PM.. Reason: Add CODE and ICODE tags, again.
# 2  
Old 01-23-2018
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?
# 3  
Old 01-24-2018
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
Mget with SFTP is not working-invalidcmdpng
# 4  
Old 01-24-2018
You need to give mget something to work with. Just 'mget' by itself is bad syntax.
# 5  
Old 01-24-2018
Quote:
Originally Posted by Corona688
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:
Code:
sftp> mget
You must specify at least one path after a mget command.

Regards,

Last edited by rbatte1; 01-26-2018 at 07:13 AM.. Reason: Added CODE tags
# 6  
Old 01-24-2018
Running my sftp (OpenSSH_7.5p1 Ubuntu-10ubuntu0.1, OpenSSL 1.0.2g 1 Mar 2016), for an mget without a path I receive
Code:
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:
Quote:
remote-path may contain glob(3) characters and may match multiple files.
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.
This User Gave Thanks to RudiC For This Post:
# 7  
Old 01-25-2018
Quote:
Originally Posted by johnsnow
No , its not invalid without parameter. Already tried by giving file name.

it should display like this without passing parameter:
Code:
sftp> mget
You must specify at least one path after a mget command.

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

Last edited by rbatte1; 01-26-2018 at 07:15 AM.. Reason: Retro-fitted CODE tags to match my edit to the original posting.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sftp mget file search with casensitive

Hi , we are not able to get file name is different casesensitive in sftp server. for example, if the files are any case that means upper or lower case ,i need to get the filenames using the mget command in sfp. sftp>mget Test.txt Thanks (5 Replies)
Discussion started by: bmk123
5 Replies

2. Red Hat

Sftp command not working

What is wrong with this sftp command being used in one line: sftp /Data/SEmisstn.gz lsmsadit@144.226.213.23:/test/lsms.SEmisstn.gz The ssh key is already setup. The node is valid and i can ssh to it as well as do a manual step by step sftp to the server. However, for some odd reason, i... (10 Replies)
Discussion started by: mrn6430
10 Replies

3. Shell Programming and Scripting

sftp autologin is working but ...

Dears, I am new to linux scripting and I was look for a way to auto login to a server using sftp to download a file. I found one and it is working fine. But i don't know the meaning of <<EOF in the code. Any one explain it to me: #!/bin/sh HOST=yourservername USER=yourusername ... (1 Reply)
Discussion started by: torabi
1 Replies

4. Solaris

Why is sftp working but ftp not

I am not very familiar with the use of FTP, and trying to run it I found out that standard "ftp" is not working" but "sftp" is. If sftp is allowed will that block ftp ? and if so where is this set ? I thought there is no relationship, is that right ? If so look here: inetadm | grep ftp enabled... (11 Replies)
Discussion started by: manni2
11 Replies

5. Shell Programming and Scripting

FTP mget * not working after change directory -cd

Hi everyone, I have an Linux FTP script to get files from different AS400 mailboxes and store in different local directories. I had to use mget * option becuase there is no fixed destination file name means filename can change. The following FTP script is working fine if we have single file... (5 Replies)
Discussion started by: oravikiran
5 Replies

6. UNIX for Advanced & Expert Users

SFTP Not Working With CRON

Hello - I have a production stream that is scheduled with cron to run each Monday morning. The jobs in the stream perform tasks including FTP get, load to a DB table, and report processing. About a month ago I was directed to begin using sftp in these jobs and since then the jobs... (12 Replies)
Discussion started by: PatrickPurfield
12 Replies

7. Shell Programming and Scripting

sftp mget where file doesn't exist BASH

I have a script that is working: #!/bin/bash sftp user@domain.com <<EOF cd somedir mget *.csv quit EOF but on a crontab I want to only pull newer files, so I want to do something like: while read ls current dir local file != true do mget that new file but I'm not sure the syntax... (2 Replies)
Discussion started by: unclecameron
2 Replies

8. Shell Programming and Scripting

Automate SFTP is not working

Hi All:cool:, i tried to automate SFTP process after passwordless authendication. Stil i am getting error... Can anyone help.... ------------------- sample code below ------------------- sftp -v $mdskk@100.4.4.75 << EOF cd /data mget *.tar.gz bye EOF... (2 Replies)
Discussion started by: senthil_seera
2 Replies

9. UNIX for Dummies Questions & Answers

sftp not working as cronjob

hi, I have a script that will automatically login into a server and get a file. it is working fine if i run it on a command line. however, when i tried to run it as a cron job, it is not working. what should i do? set timeout -1 spawn /usr/bin/sftp user1@server1 match_max 100000 expect... (3 Replies)
Discussion started by: tungaw2004
3 Replies

10. Shell Programming and Scripting

SFTP not working in cron

Hi, I have a simple script that is trying to put a file that resides on a local machine to a remote machine. It runs fine manually but does not complete when scheduling to run in cron. Here is what the script looks like. Any idea what I am doing wrong here? #!/bin/ksh cd /path sftp... (4 Replies)
Discussion started by: ewilson0265
4 Replies
Login or Register to Ask a Question