Sponsored Content
Operating Systems Linux Put -r is not working in SFTP Post 303006105 by RavinderSingh13 on Thursday 26th of October 2017 06:34:10 PM
Old 10-26-2017
Quote:
Originally Posted by kirans.229
Hi Folks,
I am trying to copy a directory along with sub-directories to SFTP server.
I have connected to SFTP and tried to run the below command:
sftp> get -r abc/*
It is throwing the error Invalid flag -r
Can you please let me know the ways to copy a directory from Local to SFTP
Hello kirans.229,

Systems is saying correct only. You need not to use -r option, so here is an example which I tried on my test server to download files by using sftp to my current server.
Code:
sftp singh_user@chumma_server
Connecting to chumma_server...
singh_user@chumma_server's password:
sftp> get /my/script/learning/*
Fetching /my/script/learning/array_example.php to array_example.php
/my/script/learning/array_example.php                                                                                          100%  149     0.2KB/s   00:00
Fetching /my/script/learning/create_submit.php to create_submit.php
/my/script/learning/create_submit.php                                                                                          100%  164     0.2KB/s   00:01
Fetching /my/script/learning/fil.ksh to fil.ksh
/my/script/learning/fil.ksh                                                                                                    100%  121     0.1KB/s   00:00

I hope this helps you, please do let us know in case of any queries on same.

Thanks,
R. Singh
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SFTP - 'put' doing an 'mput'

Hi guys, I'm having a problem with F-Secure Unix. When I try a simple command; sftp> put local.test remote.test I expect that the local file local.test would be copied to the remote file remote.test However sftp is attempting to copy local.test & remote.test from the local machine, as if... (2 Replies)
Discussion started by: b0bbins
2 Replies

2. UNIX and Linux Applications

sftp -> put : How to uplaod only newer files

I have tried winscp, filezilla to copy data from windows xp SP2 machine to the sun sparc unix machine. However speed is around 120 to 130 kb/sec. I do have lot of files & with large size. So I switched to windows command prompt & transfered few files using sftp command. Its very fast as compared... (0 Replies)
Discussion started by: _prasad
0 Replies

3. Shell Programming and Scripting

Script is not working when put in crontab

Hi there, this is part of my script: /usr/bin/cd /u01/oradata /usr/bin/cp `/bin/ls -1 . |grep -v "^DIMStemp01.dbf$" | grep -v "^DIMSts01.dbf$"|grep -v "^DIMStects01.dbf$"` /backup It's working fine when I manually run on telnet session. /bin/ls -1 . -- to list all the files inside... (2 Replies)
Discussion started by: *Jess*
2 Replies

4. UNIX for Advanced & Expert Users

SFTP - Overwrite [Put -P <file>] option

Hi All Experts, I hope you are all ok! :D My question is simple but I was not able to find an answer in the internet, and that's why I am here! My question is: when I sftp to a server and use "put -P" option to put a file, it keeps the file's full permission and access time. Check below... (5 Replies)
Discussion started by: felipe.vinturin
5 Replies

5. Shell Programming and Scripting

put working directory in file

how to put pwd in my file my working directory is /usr/my_dir below my file aaaaaa bbbbbb so output file become /usr/my_dir aaaaaa bbbbbb (2 Replies)
Discussion started by: zulabc
2 Replies

6. Shell Programming and Scripting

SFTP bash put/get/rm check

Hello, i'm doing something like that #!/bin/sh sftp 172.18.255.140 <<End-Of-Session >> /usr/batch/logsftp.txt user batch ascii lcd /usr/batch get olaola.txt bye End-Of-Session   if then echo MAL >> /usr/batch/logsftp.txt echo $? >> /usr/batch/logsftp.txt exit $? else echo... (16 Replies)
Discussion started by: dexposit
16 Replies

7. Shell Programming and Scripting

SFTP PUT

Hi, ServerA (SFTP server) ServerB (SFTP client) ServerB:> sftp user@ServerA ServerB:> put sample.txt ServerB:> get sample2.txt My question is that which machine will encrypt the sample.txt and sample2.txt files. Thanks (8 Replies)
Discussion started by: Arpit Narula
8 Replies

8. Shell Programming and Scripting

In put password automatically to sftp command

Hi all, i have to sftp a file to another server I don't have "expect" or sshpass on my machine its solaris 10, i want to pass password in command line or after doing this sftp user@server how to automatically provide the password as input ( stored in some variable or so) ... (1 Reply)
Discussion started by: zozoo
1 Replies

9. Shell Programming and Scripting

./CARE_SM_SFTP.sh[27]: put: not found error while doing sftp

Hi, I am getting the below error while doing sftp in a script file but the same is getting executed when i run from command prompt ./CARE_SM2_SFTP.sh: put: not found Code :- sftp ${USER_ID}@${FTPHOST4}:/opt/path put <Filename with path> chmod 777 <FileName with Path>... (2 Replies)
Discussion started by: satishmallidi
2 Replies

10. UNIX for Beginners Questions & Answers

Sftp,[put] all files that are .csv to server. Linux Ubuntu

Hello all, I am trying to sftp files to a server, I am using keys as authentication and I can connect with no problems. I can also put a sample file on the server. When I tried to automate this process with a .sh file I get the "couldn't canonicalize: Failure". This is my script: sftp... (5 Replies)
Discussion started by: KidKoder
5 Replies
CURLOPT_FTP_CREATE_MISSING_DIRS(3)			     curl_easy_setopt options				CURLOPT_FTP_CREATE_MISSING_DIRS(3)

NAME
CURLOPT_FTP_CREATE_MISSING_DIRS - create missing dirs for FTP and SFTP SYNOPSIS
#include <curl/curl.h> typedef enum { CURLFTP_CREATE_DIR_NONE, CURLFTP_CREATE_DIR, CURLFTP_CREATE_DIR_RETRY } curl_ftpcreatedir; CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_CREATE_MISSING_DIRS, long create); DESCRIPTION
Pass a long telling libcurl to create the dir. If the value is CURLFTP_CREATE_DIR (1), libcurl will attempt to create any remote directory that it fails to "move" into. For FTP requests, that means a CWD command fails. CWD being the command that changes working directory. For SFTP requests, libcurl will attempt to create the remote directory if it can't obtain a handle to the target-location. The creation will fail if a file of the same name as the directory to create already exists or lack of permissions prevents creation. Setting create to CURLFTP_CREATE_DIR_RETRY (2), tells libcurl to retry the CWD command again if the subsequent MKD command fails. This is especially useful if you're doing many simultaneous connections against the same server and they all have this option enabled, as then CWD may first fail but then another connection does MKD before this connection and thus MKD fails but trying CWD works! DEFAULT
CURLFTP_CREATE_DIR_NONE (0) PROTOCOLS
FTP and SFTP EXAMPLE
TODO AVAILABILITY
Added in 7.10.7. SFTP support added in 7.16.3. The retry option was added in 7.19.4. RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if the create value is not. SEE ALSO
CURLOPT_FTP_FILEMETHOD(3), CURLOPT_FTP_USE_EPSV(3), libcurl 7.54.0 February 03, 2016 CURLOPT_FTP_CREATE_MISSING_DIRS(3)
All times are GMT -4. The time now is 08:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy