Do you know how long the commands on the remote machine will approximately take? If so you could run the ssh-command in the background and then use sleep to let pass this time (plus some for contingency). If the command the still runs, you consider it to be hanging and kill it, if it has finished it is ok. You can use the "jobs" built-in ksh command to check the status of the job.
We suppose the commands you want to run remotely will take 20 seconds approximately. We add 10 seconds just to be sure and put the IP adress of the host to be contacted in a variable which is read in a loop :
The first "jobs" statement is there to clear the display of all the "done"-messages if backgroup jobs already terminated during the sleep-statement.
We have a unix script scheduled to execute once in a day, some times it hangs on the server and never performs its operations, we need to manually kill the process and re-start that script, is there any way to have notification when the script hangs on the server.
Thanks & Regards,
Murthy. (3 Replies)
Hi,
Im creating a script that is supposed to run commands on remote server using sftp.
My script is as below:
#!/bin/ksh
sftp remote_server
mypassword
cd /u08/mydir/allfiles
mget *
..
But this is what I got when I runned the script:
Connecting to remote server...... (3 Replies)
Hi, I have googled for quite some time and couldn't able to get what exactly I am looking for.. My query is "how to stop a shell script which is running inside a remote server, using a script"??? can any one give some suggestions to sort this out. (1 Reply)
Hi All,
I am using a expect script to run a shell script on remote server, the code is as follows. But the problem is that it executes only first command, and hangs it doesn't run the next commands.
spawn ssh $uid@$host
expect "password:"
send "$password\r"
expect "*\r"
send... (2 Replies)
hi,
I am using the below line to run a script from remote server(say server A) to another server(say server B).
ssh username@servername ksh script name.
The issue is the script logs into server B, executes the script on server B, transfers the file to server A but does not exit from... (4 Replies)
Hi,
I am trying to automate the process of fetching files from remote server to local server through sftp. I have the username and password for the remote solaris server. But I need to give password manually everytime i run the script.
Can anyone help me in automating the script such that it... (3 Replies)
Hi guys,
So i am in server1 and i have to login to server 2, 3,4 and run some script there(logging script) and output its result. What i am doing is running the script in server2 and outputting it to a file in server 2 and then Scp'ing the file to server1. Similarly i am doing this for other... (5 Replies)
Hello Every one!!
I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server.
Before this I am using a sudo command to change the user.
The place where I am stuck is, I am able to connect to the... (6 Replies)
I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code
TARFILE=${NAME}.tar
TARGZFILE=${NAME}.tar.gz
ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
local script:
cat > first.sh
cd /tmp
echo $PWD
echo `whoami`
cd /tmp/123
tar -cvf 789.tar 456
sleep 10
except script:
cat > first
#!/usr/bin/expect
set ip 10.5.15.20
set user "xyz123"
set password "123456"
set script first.sh
spawn sh -c "ssh $user@$ip bash < $script" (1 Reply)
Discussion started by: Aditya Avanth
1 Replies
LEARN ABOUT DEBIAN
ka-forwarder
KA-FORWARDER(8) AFS Command Reference KA-FORWARDER(8)NAME
ka-forwarder - Forward AFS Authentication Server requests to another server
SYNOPSIS
ka-forwarder [-p <port>] <server>[/<port>] [...]
DESCRIPTION
ka-forwarder listens for requests for an AFS Authentication Server and forwards them to a remove fakeka server. fakeka is a server that
answers AFS Authentication Server protocol requests using a regular Kerberos KDC and is provided with some Kerberos 5 implementations.
fakeka has to run on the same host as the Kerberos KDC, however, and AFS clients send all native AFS authentication requests to the AFS
database servers. If you don't want to run your Kerberos KDCs and your AFS database servers on the same host, run ka-forwarder on the AFS
database servers and point it to fakeka running on the Kerberos KDCs.
ka-forwarder takes one or more servers to which to forward the requests. The default port on the remote server to which to forward the
command is 7004, but a different port can be specified by following the server name with a slash ("/") and the port number. If multiple
servers are given, ka-forwarder will send queries to each server in turn in a round-robin fashion.
CAUTIONS
Due to the way that ka-forwarder distinguishes from client requests and server responses, any messages from one of the servers to which ka-
forwarder is forwarding will be considered a reply rather than a command and will not be forwarded. This means that the servers running
fakeka will not be able to use native AFS authentication requests and rely on ka-forwarder to send the requests to the right server.
ka-forwarder does not background itself. It should either be run in the background via the shell, or run via the Basic OverSeer Server
(see bosserver(8)).
OPTIONS -p <port>
By default, ka-forwarder listens to the standard AFS Authentication Server port (7004). To listen to a different port, specify it with
the -p option.
EXAMPLES
Forward AFS Authentication Server requests to the fakeka servers on kdc1.example.com and kdc2.example.com:
% ka-forwarder kdc1.example.com kdc2.example.com &
Note the "&" to tell the shell to run this command in the background.
PRIVILEGE REQUIRED
ka-forwarder only has to listen to port 7004 and therefore does not require any special privileges unless a privileged port is specified
with the -p option.
SEE ALSO bosserver(8), fakeka(8), kaserver(8)COPYRIGHT
Copyright 2006 Russ Allbery <rra@stanford.edu>
This documentation is covered by the IBM Public License Version 1.0. This man page was written by Russ Allbery for OpenAFS.
OpenAFS 2012-03-26 KA-FORWARDER(8)