My requirement is that I should execute SFTP from /users/XYZ dir and get the file on to /users/XYZ/TEST folder with out the sys error.
I'm facing the following strange issue with SFTP execution. I need to copy a file 'abc.txt' from Remote m/c(MyServer) to local machine(Server1). I've this file in the folder /users/XYZ on MyServer and need to SFTP it to /users/ABCD on Server1.
On Server1:
-------------------------
On Server1:
-------
When I execute this, my intention was to get the file 'abc.txt' on to '/users/XYZ/TEST', but the execution seems to be a fail, but the catch is that the file gets copied to /users/XYZ, but not to my intended location.
When I'm in /users/XYZ/TEST and When I give "get /users/ABCD/abc.txt" through SFTP without local path details with out any error, the file gets placed in /users/XYZ/TEST.
Your help is highly appreciated.
Regards,
SKP
---------- Post updated at 11:45 AM ---------- Previous update was at 10:08 AM ----------
Request your help in this regad.
Last edited by Franklin52; 04-17-2013 at 03:20 AM..
Reason: Please use code tags
Hi.
I'm trying to copy multiple folders from the remote machine to the local machine. I wrote a batch file to run an ftp window.
The problem I am having is that the only command to copy files is mget *, and this copies only files, not folders.
For example, ftp ts555
cd ts555/test
' test... (5 Replies)
Hi All,
please help me to write a shell that ftp a file which is in the local (C:\) drive to a Unix server.
Where as i know the IP for the Unix server.
i could do this process by using ftp command.
pls help me to write as Shell script.
Thanks in advance for all of your answers.:b::b: (3 Replies)
Hi List,
I have set up a chrooted SFTP setup following the instructions I found on tech republic:
/blog/opensource/chroot-users-with-openssh-an-easier-way-to-confine-users-to-their-home-directories/229
I have successfully got it all working and I can download files when logged in via sftp... (0 Replies)
I'm making an sftp-connection to a remote server. I want the result of an ls-command in a local file and the result of ls on another folder in another local file. Because everything has to go as fast a possible I wan't to do everyting in one connection.
The command I use is : psftp -v -batch -b... (4 Replies)
Hi,
Is there a way I can copy a file from a server to a local folder (i.e. My Documents)? can it be done by scp?
I tried this but it just rename the file as the folder it has to be transferred at.
scp -r name@some_server:/home/user/file.txt 'somehere\home\home_dir'
Thanks. (4 Replies)
Hi,
Below script used for sftp get,
#/bin/bash
USER=xxx
PASS=xxx
HOST=xxx
REMOTE_FILE=$1
LOCAL_FILE_LOC=$2
cd $LOCAL_FILE_LOC
lftp sftp://$USER:$PASS@$HOST:10022 -e "get $REMOTE_FILE; bye"
If file does not exist in sftp server, and file (same as remote file name) exists in local dir,... (4 Replies)
Hi.
I have managed to transfer a file from remote to my raspberry pi, but I have the camera mounted on the Raspbien so I would like to transfer the image the other way.
I use this line:
sshpass -p 'PASSWORD' scp -- USER@ssh.servername.com:/www/cam/image.jpg /home/pi/shared/web/image.jpg (4 Replies)
I have a machine in my LAN that runs Ubuntu and I have full access in it.
There is another PC on the Internet that has a public IP eg 3.3.3.3 and it servers as https server and access to it is by username and password. On the remote PC all i have is access through https using username/passwd.
... (3 Replies)
HI Guys,
Can anyone help me to retrieve the latest file from below example using SFTP
I have below list of files in a folder
v403t.lstprgms.sortin1
val027.d099.fwest.oct2711
xcelrptd.d1400sqp.dec1713.t040459.@02del
xcelrptd.d1400sqp.dec1713.t073308.@02del... (3 Replies)
I'm using sftp to connect from a Windows server (User ID is ssh1) to AIX server (User ID ftpeapsg) to access /sftp/ftphrssg/HRSSG/EAPSG in AIX server. User ftpeapsg is created on AIX server.
Able to connect to AIX server fine without the need for password however not able to see the folder... (4 Replies)
Discussion started by: userguy
4 Replies
LEARN ABOUT CENTOS
libssh2_sftp_rename_ex
libssh2_sftp_rename_ex(3) libssh2 manual libssh2_sftp_rename_ex(3)NAME
libssh2_sftp_rename_ex - rename an SFTP file
SYNOPSIS
#include <libssh2.h> #include <libssh2_sftp.h>
int libssh2_sftp_rename_ex(LIBSSH2_SFTP *sftp, const char *source_filename, unsigned int source_filename_len, const char *dest_filename,
unsigned int dest_filename_len, long flags);
int libssh2_sftp_rename_ex(LIBSSH2_SFTP *sftp, const char *source_filename, const char *dest_filename);
DESCRIPTION
sftp - SFTP instance as returned by libssh2_sftp_init(3)
sourcefile - Path and name of the existing filesystem entry
sourcefile_len - Length of the path and name of the existing filesystem entry
destfile - Path and name of the target filesystem entry
destfile_len - Length of the path and name of the target filesystem entry
flags - Bitmask flags made up of LIBSSH2_SFTP_RENAME_* constants.
Rename a filesystem object on the remote filesystem. The semantics of this command typically include the ability to move a filsystem object
between folders and/or filesystem mounts. If the LIBSSH2_SFTP_RENAME_OVERWRITE flag is not set and the destfile entry already exists, the
operation will fail. Use of the other two flags indicate a preference (but not a requirement) for the remote end to perform an atomic
rename operation and/or using native system calls when possible.
RETURN VALUE
Return 0 on success or negative on failure. It returns LIBSSH2_ERROR_EAGAIN when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is a
negative number, it isn't really a failure per se.
ERRORS
LIBSSH2_ERROR_ALLOC - An internal memory allocation call failed.
LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket.
LIBSSH2_ERROR_SOCKET_TIMEOUT -
LIBSSH2_ERROR_SFTP_PROTOCOL - An invalid SFTP protocol response was received on the socket, or an SFTP operation caused an errorcode to be
returned by the server.
SEE ALSO libssh2_sftp_init(3)libssh2 0.15 1 Jun 2007 libssh2_sftp_rename_ex(3)