Hi,
I have tried with the following code;
if ;then
echo "Failure."
else
echo "Success."
fi
to test the exit status of the test.ksh shell script. But whatever is the exit status of the test.ksh shell script Failure. is always printed.
Please help.
regards,
Dipankar. (2 Replies)
Hi,
I am trying the following-
1. ftp a file from machine1 to machine2.
2. Once the ftp is done, from machine1 invoke a shell script on machine2.
Could anyone please help me on this? (5 Replies)
if i have a script in my system which i need to run on remote system using ssh, how shall i do it?
One easy way to to first scp it to remote machine and then run it on remote machine using ssh.
Is there any one step way to do it. Preferably one in which i should give password only once (3 Replies)
Hi All,
This was an interview question
" There is a clean-up shell-script in one UNIX machine and it is connected to 100 other UNIX machines.
Howe can we run the script on all the 100 machines without ftping/copying the script to target machines ?
I was unable to answer, please answer if... (5 Replies)
Hi there
I am in the process of writing a script to check whether a port on a remote system is up or not.
Here's what I have so far:
#!/bin/bash
telnet xx.xx.xx.xx 80 | (echo "^]")
if ]; then
echo "Please check Web services " | mailx -s "Please check webservices... (1 Reply)
Greetings...
I have to construct shell script to check the SFTP status,
Define a global variable (say sftpStatus). Set it to default value "success" when you define it first time outside the script.
check the current SFTP status (say currentStatus - local variable within the script)
if... (16 Replies)
Hi,
I want to write a script which continuously checking status of a script running in background by nohup command. And if same script is not running then immediately start the script...please help..
i am using below command to run script
nohup system_traps.sh &
but in some... (9 Replies)
I am using blow script :--
#!/bin/bash
FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not
if
then
# echo "process found"
exit 0;
else
echo "process not found"
exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
#!/bin/ksh
#This script will check status of load balancer in AIX servers from hopbox
#Steps to do as folows :
#Login to server
#netstat -ani | grep <IP>
#check if the output contains either lo0 OR en0
#if the above condition matches, validation looks good
#else, send an email with impacted... (7 Replies)
Geeks,
Could you please help me out in my script and identify the missing piece. I need to check/get the exit status of a remote command executed on remote host through script and send out an email when process/processes is/are not running on any/all server(s).
Here's the complete... (5 Replies)
Discussion started by: lovesaikrishna
5 Replies
LEARN ABOUT PHP
ftp_nb_put
FTP_NB_PUT(3) 1 FTP_NB_PUT(3)ftp_nb_put - Stores a file on the FTP server (non-blocking)SYNOPSIS
int ftp_nb_put (resource $ftp_stream, string $remote_file, string $local_file, int $mode, [int $startpos])
DESCRIPTION ftp_nb_put(3) stores a local file on the FTP server.
The difference between this function and the ftp_put(3) is that this function uploads the file asynchronously, so your program can perform
other operations while the file is being uploaded.
PARAMETERS
o $ftp_stream
- The link identifier of the FTP connection.
o $remote_file
- The remote file path.
o $local_file
- The local file path.
o $mode
- The transfer mode. Must be either FTP_ASCII or FTP_BINARY.
o $startpos
-The position in the remote file to start uploading to.
RETURN VALUES
Returns FTP_FAILED or FTP_FINISHED or FTP_MOREDATA.
EXAMPLES
Example #1
ftp_nb_put(3) example
<?php
// Initiate the Upload
$ret = ftp_nb_put($my_connection, "test.remote", "test.local", FTP_BINARY);
while ($ret == FTP_MOREDATA) {
// Do whatever you want
echo ".";
// Continue uploading...
$ret = ftp_nb_continue($my_connection);
}
if ($ret != FTP_FINISHED) {
echo "There was an error uploading the file...";
exit(1);
}
?>
Example #2
Resuming an upload with ftp_nb_put(3)
<?php
// Initiate
$ret = ftp_nb_put($my_connection, "test.remote", "test.local",
FTP_BINARY, ftp_size("test.remote"));
// OR: $ret = ftp_nb_put($my_connection, "test.remote", "test.local",
// FTP_BINARY, FTP_AUTORESUME);
while ($ret == FTP_MOREDATA) {
// Do whatever you want
echo ".";
// Continue uploading...
$ret = ftp_nb_continue($my_connection);
}
if ($ret != FTP_FINISHED) {
echo "There was an error uploading the file...";
exit(1);
}
?>
SEE ALSO ftp_nb_fput(3), ftp_nb_continue(3), ftp_put(3), ftp_fput(3).
PHP Documentation Group FTP_NB_PUT(3)