08-25-2015
A few points I think I should mention:-
- You are needlessly issuing chmod as the file will be RW by you in any case and there is no need to execute it - it's just the output from ps after all.
.
- You ssh finishes and the file $J_NAME.pid is written to the local server, not the remote.
You then try to kill the remote process on the local server which could be very bad if you have a process id locally that matches.
Create your script on the remote server, then execute it as one process.
i hope that this helps,
Robin
10 More Discussions You Might Find Interesting
1. Solaris
I am looking for a dial-up remote printing solution as under :
1. We have a Centralized location where Sun Solaris (A) is installed. From here printing command will be despatched.
2. This printing command will be routed to WAN cloud to Main Branches (B1,B2,B3)and from there, printer at... (0 Replies)
Discussion started by: jayvee
0 Replies
2. Solaris
how to login with ssh to remote system with out applying the remote root/user password
with rlogin we can ujse .rhosts file
but with ssh howits possible
plz guide (2 Replies)
Discussion started by: tv.praveenkumar
2 Replies
3. Debian
Hi,
I've been looking for a way to execute a console program (is in windows but by now I accept the linux way) from a linux machine, but this program has to be opened in the remote side. Linux machine acts only as a "signaling" host. My program has to open the camera in the remote side, but only... (7 Replies)
Discussion started by: zauberberg
7 Replies
4. Shell Programming and Scripting
I m trying to run a batch script in remote desktop which executes unix commands on the unix server...the problem is i wnt the output in HTML format.so in my batch script i m giving the cmd like
ssh hostname path ksh HC_Report.ksh>out.html
...but it generates the HTML file in
remote desktop .i... (2 Replies)
Discussion started by: navsan
2 Replies
5. UNIX for Dummies Questions & Answers
I was wondering why does ssh store the fingerprints of remote host when connecting for the first time?
I will appreciate a detailed response, can't figure it out. (2 Replies)
Discussion started by: ChiefGandalf
2 Replies
6. Shell Programming and Scripting
Hi,
I need to ssh remotely to a machine and cat a file assign the value to a variable
Script:
#!/bin/bash -x
value=`cat config.txt`
echo "$value"
ssh me@xxx.host.com "valu='cat /export/home/test.md5'; echo "$valu"" | tee
Execution:
$ ./x
++ cat config.txt
+ value='touch me'
+... (5 Replies)
Discussion started by: close2jay
5 Replies
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
Hi all,
i'm trying to gether multiple pattern on remote hosts, and trying to print hostname and the pattern,
ssh remoteserver1 -C 'hostname 2>&1;cat /var/log/server1.log | awk -F ";" '"'"'{ print " "$2" "$5}'"'"'| sort | uniq -c | sort -g -r '
The output is the following,
remoteserver1
... (8 Replies)
Discussion started by: charli1
8 Replies
9. Shell Programming and Scripting
I have a variable called $a1 which maps to something like "http://servername proxy1 count http" and a lots of entries in a file on remote server.
If I have the following in my .sh script:
sed -i "\%$a1%d" mylog.txtthe line is deleted from mylog.txt. Great.
I'm trying now to remvoe this from a... (3 Replies)
Discussion started by: say170
3 Replies
10. UNIX for Beginners Questions & Answers
Hi~
i have an authorized key which it made remote host(B).
i want log on without password from local(A) to the remote host(B) using authorized key of remote host.
what shell i do? anybody help me. (1 Reply)
Discussion started by: tomato00
1 Replies
CFTP(1) BSD General Commands Manual CFTP(1)
NAME
cftp -- Conch command-line SFTP client
SYNOPSIS
cftp [-B buffer_size] [-b command_file] [-R num_requests] [-s subsystem]
DESCRIPTION
is a client for logging into a remote machine and executing commands to send and receive file information. It can wrap a number of file
transfer subsystems
The options are as follows:
-B Specifies the default size of the buffer to use for sending and receiving. (Default value: 32768 bytes.)
-b File to read commands from, '-' for stdin. (Default value: interactive/stdin.)
-R Number of requests to make before waiting for a reply.
-s Subsystem/server program to connect to.
The following commands are recognised by :
cd path
Change the remote directory to 'path'.
chgrp gid path
Change the gid of 'path' to 'gid'.
chmod mode path
Change mode of 'path' to 'mode'.
chown uid path
Change uid of 'path' to 'uid'.
exit Disconnect from the server.
get remote-path [local-path]
Get remote file and optionally store it at specified local path.
help Get a list of available commands.
lcd path
Change local directory to 'path'.
lls [ls-options [path]]
Display local directory listing.
lmkdir path
Create local directory.
ln linkpath targetpath
Symlink remote file.
lpwd Print the local working directory.
ls [-l [path]]
Display remote directory listing.
mkdir path
Create remote directory.
progress
Toggle progress bar.
put local-path [remote-path]
Transfer local file to remote location
pwd Print the remote working directory.
quit Disconnect from the server.
rename oldpath newpath
Rename remote file.
rmdir path
Remove remote directory.
rm path
Remove remote file.
version
Print the SFTP version.
? Synonym for 'help'.
AUTHOR
cftp by Paul Swartz <z3p@twistedmatrix.com>. Man page by Mary Gardiner <mary@twistedmatrix.com>.
REPORTING BUGS
Report bugs to http://twistedmatrix.com/bugs/
COPYRIGHT
Copyright (C) 2005-2008 Twisted Matrix Laboratories
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
BSD
October 8, 2005 BSD