Mget with SFTP is not working


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Mget with SFTP is not working
# 8  
Old 01-26-2018
Quote:
Originally Posted by RudiC
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: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.
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 ----------

Quote:
Originally Posted by Corona688
And what happens when you DO give at least one path after mget command?
it says invalid command
# 9  
Old 01-26-2018
Quote:
Originally Posted by johnsnow
it says invalid command
It is really strange for mget to not work. Check for typos and carriage returns in your script file
# 10  
Old 01-31-2018
Quote:
Originally Posted by Corona688
And what happens when you DO give at least one path after mget command?
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 ----------

Quote:
Originally Posted by RudiC
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: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.

Hi ,

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

Regards,
Babu
# 11  
Old 01-31-2018
Quote:
Originally Posted by johnsnow
get( to multiple files) is working fine. But only concern is it will override the files. mget doesnot.
Override what? I don't understand what you're expecting.
# 12  
Old 01-31-2018
Overwrite...?

Not sure mget doesn't...
# 13  
Old 02-01-2018
Quote:
Originally Posted by Corona688
Override what? I don't understand what you're expecting.
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 ----------

Quote:
Originally Posted by RudiC
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.
# 14  
Old 02-02-2018
Which is contradictory to what you said in post#10 and previous.
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