In my project we use sftp with batch mode (password less) script in parallel for 14 sessions which connects to 2 different servers alternatively i.e. 7 connects to one server say server1 and the other 7 connects to say server 2.
Now the problem is that these 14 sessions are run in parallel then only 2 or 3 of them get succeeded while the rest runs for a very long time like 2 hours and then gets timed out. The unix admins told that sftp script is not closing the connection gracefully.
The command which I use in the sftp script is
They told me to check if the connections are closed or not can be checked by command. So I executed the below command even when the sessions were not running.
This shows something like below:
And seeing the above "ESTABLISHED" o/p they are claiming that my script is not closing the FTP connection!! I'm really confused as to how to close the SFTP connection when using it in batch mode there is no explicit command like "bye" with password-less sftp. Can anybody please help me understand that if the unix admins are right in their claim that really my script doesn't close the connection automatically and if yes then how to close it?
Hi
what is the command to see the process name/application name
along with the port number, connection status ...
netstat is not giving process/application name
Is there any way to know which application is holding which port?
Thanks in advance (3 Replies)
Hi..,
Now, I am reading about the netstat command and its implementation. I have doubts in some options and its functionalities,
natstat - M (Which is described as display masqueraded connections), what it means?
What is Forwarding Information Base.?(--fib)
Thanks in advance,... (3 Replies)
Do I have this command correct to show all current connections/sessions my Solaris box has? It does not seem to do anything.
netstat -an | grep EST (6 Replies)
Hi
Can any body tell me about TIME_WAIT status meaning in the following command output.
# netstat -anp|grep 5000
tcp 0 0 127.0.0.1:50006 0.0.0.0:* LISTEN 5058/ccsd
tcp 0 0 0.0.0.0:50008 0.0.0.0:* ... (3 Replies)
Hi All,
Need to run the netstat -i command on the list of hosts and check if "Ierrs" and "Oerrs" has value greaterthan 0.
for Ex: below output, driver bge1 and bge3 has Oerrs and Ierrs value > 0, So, script should report saying
"Netstat status for $host, driver bge1 has Oerrs = 20, Failed"... (5 Replies)
Help required for creating a unix shell script using netstat command for retrieving total traffic in Kbytes with the source and destination address. (4 Replies)
Hi All,
We have this regex:\\*.*?(.600).*?.(LISTEN|ESTABLISHED)
OS = Solaris 10
The purpose of this regex is to match the ports in output of "netstat -an" and report if any ports between 6000-6009 are getting used. The only problem is if I have something like this (sample output as... (6 Replies)
Hi All,
I am trying to collect the listen ports info from netstat command in centos 7
From that info i am trying to collect all the foreign address IP for those ports.
I am using below script to do the same.
netstat -an |grep -w "LISTEN" |grep -v "127.0.0.1" |awk '{print $4}' >... (3 Replies)
Discussion started by: sravani25
3 Replies
LEARN ABOUT PHP
ssh2_sftp_mkdir
SSH2_SFTP_MKDIR(3) 1 SSH2_SFTP_MKDIR(3)ssh2_sftp_mkdir - Create a directorySYNOPSIS
bool ssh2_sftp_mkdir (resource $sftp, string $dirname, [int $mode = 0777], [bool $recursive = false])
DESCRIPTION
Creates a directory on the remote file server with permissions set to $mode.
This function is similar to using mkdir(3) with the ssh2.sftp:// wrapper.
PARAMETERS
o $sftp
- An SSH2 SFTP resource opened by ssh2_sftp(3).
o $dirname
- Path of the new directory.
o $mode
- Permissions on the new directory.
o $recursive
- If $recursive is TRUE any parent directories required for $dirname will be automatically created as well.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Creating a directory on a remote server
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$sftp = ssh2_sftp($connection);
ssh2_sftp_mkdir($sftp, '/home/username/newdir');
/* Or: mkdir("ssh2.sftp://$sftp/home/username/newdir"); */
?>
SEE ALSO mkdir(3), ssh2_sftp_rmdir(3).
PHP Documentation Group SSH2_SFTP_MKDIR(3)