04-23-2016
Good points. But - that wasn't meant as a solution but as a direction to think into. Unfortunately, unlike ftp, sftpis a handled as a subsystem of the sshd daemon. I'm not sure if it could be modified (e.g. replaced by a wrapper script) to detect/handle connects and disconnects.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Has anybody been able to execute a shell script call from a database trigger?
If so what are the steps to execute it? Do we have any specific packages in Oracle?
Reards,
Rahul. (1 Reply)
Discussion started by: rahulrathod
1 Replies
2. Shell Programming and Scripting
HI,
I have a script which will be running all the time...it is like a trigger.. wakesup every 10 minutes(trigger.sh) executes, and I want to write another script which monitors this script every one hour and if it finds that trigger script is not running it should start it and exit...and here... (9 Replies)
Discussion started by: mgirinath
9 Replies
3. UNIX for Dummies Questions & Answers
Hi,
My program A updates a log called logA.
I have a shell script S that is responsible to send emails reading from the log.
I want to trigger execution of the script whenever there is an update to the log.
Thanks in advance. (8 Replies)
Discussion started by: cv_pan
8 Replies
4. Shell Programming and Scripting
Hi
I am not so good in scripting..trying ot learn it...need guidance of the experts in shell scripting..
Let me explain the scenario first..
a server MX1 is connected to another server MX2 through vpn..every 5 minute a script runs to test vpn connectivity between the 2 servers.when the vpn... (12 Replies)
Discussion started by: renuka
12 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am a Unix Newbie :D.
I want to write a program such a way that:
Whenever number of filedescriptors opened by a process change, it should execute some commands (eg: write total number of FDs at that point of time to a file).
I dont want to poll '/proc/<pid>/fd' at regular intervals... (3 Replies)
Discussion started by: poweruser
3 Replies
6. UNIX for Dummies Questions & Answers
Hi Gurus,
I am trying to write a script for checking the status of linux servers by connecting via telnet with port no but to terminate i have to manually type "quit" .how can i terminate the telnet session in script itself.For E.g
=========================================
telnet ipaddress... (3 Replies)
Discussion started by: kapil514
3 Replies
7. Shell Programming and Scripting
Hi All,
Please see the below code.
it is working fine when in 'test_file' have only one emplid.
test_file contains only emplid and date, like below ...
0000221|1/12/2003
0000223|1/1/1996
Problem :-
when test_file contains more then one records(emplids) it is not giving any errors... (3 Replies)
Discussion started by: krupasindhu18
3 Replies
8. Shell Programming and Scripting
Hi,
I'm looking for a way to solve the following scenario:
A shell should automatically trigger / run when a text file is placed or present at a specific location.
My idea - to create a cron / anacron for every minute and inside that i will call a temp script. Temp script will move to my... (9 Replies)
Discussion started by: Gautham
9 Replies
9. Shell Programming and Scripting
Hi Guys,
I have a main_script.sh which runs every day and scheduled in crontab.
in the main script i read data from config file
test.config
apple
mango
orange
main_script.sh
for i in `cat test.config`
do
if
then
echo 'Apple' (3 Replies)
Discussion started by: Master_Mind
3 Replies
10. Shell Programming and Scripting
Hi Guys,
I am having below code which runs based on condition, Is it possible to check condition at the time of trigger
code=$1
if ;then
nohup sh script.sh $val 1 &
fi
I need to trigger if the $code = JP then only to trigger nohup sh script.sh $val 1 &
My try but wanted... (4 Replies)
Discussion started by: Master_Mind
4 Replies
LEARN ABOUT DEBIAN
libssh2_sftp_fstatvfs
libssh2_sftp_statvfs(3) libssh2 manual libssh2_sftp_statvfs(3)
NAME
libssh2_sftp_statvfs, libssh2_sftp_fstatvfs - get file system statistics
SYNOPSIS
#include <libssh2.h>
#include <libssh2_sftp.h>
int
libssh2_sftp_statvfs(LIBSSH2_SFTP *sftp, const char *path,
size_t path_len, LIBSSH2_SFTP_STATVFS *st);
int
libssh2_sftp_fstatvfs(LIBSSH2_SFTP_HANDLE *handle,
LIBSSH2_SFTP_STATVFS *st)
DESCRIPTION
These functions provide statvfs(2)-like operations and require statvfs@openssh.com and fstatvfs@openssh.com extension support on the
server.
sftp - SFTP instance as returned by libssh2_sftp_init(3)
handle - SFTP File Handle as returned by libssh2_sftp_open_ex(3)
path - full path of any file within the mounted file system.
path_len - length of the full path.
st - Pointer to a LIBSSH2_SFTP_STATVFS structure to place file system statistics into.
DATA TYPES
LIBSSH2_SFTP_STATVFS is a typedefed struct that is defined as below
struct _LIBSSH2_SFTP_STATVFS {
libssh2_uint64_t f_bsize; /* file system block size */
libssh2_uint64_t f_frsize; /* fragment size */
libssh2_uint64_t f_blocks; /* size of fs in f_frsize units */
libssh2_uint64_t f_bfree; /* # free blocks */
libssh2_uint64_t f_bavail; /* # free blocks for non-root */
libssh2_uint64_t f_files; /* # inodes */
libssh2_uint64_t f_ffree; /* # free inodes */
libssh2_uint64_t f_favail; /* # free inodes for non-root */
libssh2_uint64_t f_fsid; /* file system ID */
libssh2_uint64_t f_flag; /* mount flags */
libssh2_uint64_t f_namemax; /* maximum filename length */
};
It is unspecified whether all members of the returned struct have meaningful values on all file systems.
The field f_flag is a bit mask. Bits are defined as follows:
LIBSSH2_SFTP_ST_RDONLY
Read-only file system.
LIBSSH2_SFTP_ST_NOSUID
Set-user-ID/set-group-ID bits are ignored by exec(3).
RETURN VALUE
Returns 0 on success or negative on failure. If used in non-blocking mode, 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.
AVAILABILITY
Added in libssh2 1.2.6
SEE ALSO
libssh2_sftp_open_ex(3)
libssh2 1.2.6 22 May 2010 libssh2_sftp_statvfs(3)