Hello!!!
I need a korn shell script in AIX that inside sftp environment, changes a remote directory, lists the files inside it, and stores in an array.
I got it working before make a sftp, but after.. I can't..
The way it is, it lists the files in local path... so.. not what I want, but... (1 Reply)
Hi all
Trying to run my korn shell script, I got no messages after the sftp.
The "finished" msg is not being displayed.
Any ideas?
sftp $argument <<EOF
quit
EOF
echo "finished"
Thanks in advance,
:O) (1 Reply)
Hi,
I am using few ISQL statements to update and delete from a few tables in sybase, now i want to roll back the transaction when any of the statements fail.How i can i capture these errors in the shell scripts.Please advise.
Thanks,
Gopi (4 Replies)
Hi All, I am new to this forum as well as to unix scripting.
Can you please help me to create a korn shell script to find out errors in logfiles and get the name of that logfile ( which is having error) in email and email it to me? (2 Replies)
Hi All
I have a FTP script which FTPs few files into an user folder. I intend to keep track of the folder size before FTP and after FTP and print that once the FTP script is run (a kind of comparison, "Before FTP, "After FTP").
I decided to use kron shells to accomplish this.
#! /bin/ksh
... (2 Replies)
Hi All,
I am able to SFTP files using the below command in my script.
sftp -b test.bat $user@$IP << EOF
i have written the following command in the test.bat file
put /home/user1/testfile.txt /ftpdata/out/
quit
i am able to sftp the testfile.txt from one server to another. could any... (1 Reply)
Hi, need help, I would like to know what is this IF statement trying to do? When the script is executing and error out with line 9 which is the IF statement line.
if ]
then
TOPDIR=$(pwd)
else
TOPDIR=${0%/*}
fi
TOPDIR=${TOPDIR%/*}
the log file.
Current system time is... (15 Replies)
Hi,
I have situation where i need to automate transferring 10000+ files using sftp.
while read line
do
if ; then
echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt
fi
done< files.txt
sftp -b sftpCommand.txt stu@192.168.2.1
The above... (1 Reply)
Hi this is my first post, so forgive me if what I'm requesting doesn't make sense.
I'm connecting into a Unix server via SSH and using a Korn Shell (#!/bin/ksh). The Unix server has Oracle 11g installed on it and there are a number of scripts already setup to query the Oracle database to perform... (2 Replies)
Hi All,
Need help in below query, appreciate your help.
We are changing a FTP process to SFTP ( passwordless SSH )
I had few queries on how to log the transfer details into a log file.
-----------------------------------------------------
PUTLOGFILE= /xxx/ftp_log.log
FAILPUTLOGFILE=... (0 Replies)
Discussion started by: aadarshtripathi
0 Replies
LEARN ABOUT CENTOS
libssh2_sftp_open_ex
libssh2_sftp_open_ex(3) libssh2 manual libssh2_sftp_open_ex(3)NAME
libssh2_sftp_open - open filehandle for file on SFTP.
SYNOPSIS
#include <libssh2.h>
#include <libssh2_sftp.h>
LIBSSH2_SFTP_HANDLE *
libssh2_sftp_open_ex(LIBSSH2_SFTP *sftp, const char *filename,
unsigned int filename_len, unsigned long flags,
long mode, int open_type);
DESCRIPTION
sftp - SFTP instance as returned by libssh2_sftp_init(3)
filename - Remote file/directory resource to open
filename_len - Length of filename
flags - Any reasonable combination of the LIBSSH2_FXF_* constants:
LIBSSH2_FXF_READ
Open the file for reading.
LIBSSH2_FXF_WRITE
Open the file for writing. If both this and LIBSSH2_FXF_READ are specified, the file is opened for both reading and writing.
LIBSSH2_FXF_APPEND
Force all writes to append data at the end of the file.
LIBSSH2_FXF_CREAT,
If this flag is specified, then a new file will be created if one does not already exist (if LIBSSH2_FXF_TRUNC is specified,
the new file will be truncated to zero length if it previously exists)
LIBSSH2_FXF_TRUNC
Forces an existing file with the same name to be truncated to zero length when creating a file by specifying LIB-
SSH2_FXF_CREAT. LIBSSH2_FXF_CREAT MUST also be specified if this flag is used.
LIBSSH2_FXF_EXCL
Causes the request to fail if the named file already exists. LIBSSH2_FXF_CREAT MUST also be specified if this flag is used.
mode - POSIX file permissions to assign if the file is being newly created. See the LIBSSH2_SFTP_S_* convenience defines in <lib-
ssh2_sftp.h>
open_type - Either of LIBSSH2_SFTP_OPENFILE (to open a file) or LIBSSH2_SFTP_OPENDIR (to open a directory).
RETURN VALUE
A pointer to the newly created LIBSSH2_SFTP_HANDLE instance or NULL on failure.
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.
LIBSSH2_ERROR_EAGAIN - Marked for non-blocking I/O but the call would block.
SEE ALSO libssh2_sftp_close_handle(3)libssh2 0.15 1 Jun 2007 libssh2_sftp_open_ex(3)