Sponsored Content
Full Discussion: Ssh in the background
Top Forums Shell Programming and Scripting Ssh in the background Post 302835053 by RudiC on Sunday 21st of July 2013 04:05:39 PM
Old 07-21-2013
Quote:
Originally Posted by vital_parsley
. . .
How do i do it ? without showing anything on my script.
Redirect stdout and stderr to a log file (for error analysis) or to /dev/null.
This User Gave Thanks to RudiC For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using ssh to execute a remote script in the background

Help please!! I want to use ssh to execute a remote exe and while it's running I want to query for the process ID of the exe (2 different ssh commands) 1. sshpass -p "<passwd>" ssh -f -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@<ipaddress> nohup /tmp/mmds_asyn & 2.... (0 Replies)
Discussion started by: rvompoluTMW
0 Replies

2. Shell Programming and Scripting

PID from background ssh

Hello. I was wondering if someone can help me out with something. To simplify my life, I have written a tiny script to open an ssh tunnel through another linux host so that I can access the esxi hosts on that network using the client. For this I have to tunnel ports 443, 902, and 903. Here is what... (1 Reply)
Discussion started by: numetheus
1 Replies

3. Programming

Background (nohup * &) SSH command block possible?

Hello, I am trying to find a way to send several sequential commands via SSH to a remote box in a single command. Thoughts so far: 1) Can I put them into a function and call the function within the ssh command? e.g. ssh <targetserver> $(functionx) No - then it calls the function in... (4 Replies)
Discussion started by: doonan_79
4 Replies

4. Programming

Background SSH using here document

I'm trying to use Here documents to pass several commands to a remote server over SSH. However I'm having problems. The code is as follows: nohup ssh $i_hostname exec /usr/bin/ksh -s << EOF >> $AS_STOPSAP_LOG & echo $i_instname; ps -ef | grep name | grep ${i_instname} |grep -v grep ... (4 Replies)
Discussion started by: doonan_79
4 Replies

5. Shell Programming and Scripting

Ssh = ssh expect and keep everything not change include parameter postion

I have write a script which contains ssh -p 12345 dcplatform@10.125.42.50 ssh 127.0.0.1 -p 5555 "$CMD" ssh root@$GUEST_IP "$CMD" before I use public key, it works well, now I want to change to "expect", BUT I don't want to change above code and "parameter position" I can post a... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

6. Shell Programming and Scripting

Executing a background script using ssh keys

Greetings, i've been working with a user-friendly menu on ksh to allow users execute scripts located on a remote server, so they wont have to login and manually launch those scripts every single time. This is a HP-UX box and currently on a /usr/bin/ksh shell. I've setup ssh keys on both... (1 Reply)
Discussion started by: nbriozzo
1 Replies

7. UNIX for Dummies Questions & Answers

Sudo ssh with command running in background

I am trying to run a command. This is one of my attempts: for i in fileservera; do ssh -t $i 'sudo ls /';doneThis works, and I see the directories. However, what I want to do now is start a process on the remote server such as /usr/bin/connectproc -standalonesudo /usr/bin/connectproc... (1 Reply)
Discussion started by: newbie2010
1 Replies

8. UNIX for Beginners Questions & Answers

Ssh script to validate ssh connection to multiple serves with status

Hi, I want to validate ssh connection one after one for multiple servers..... password less keys already setup but now i want to validate if ssh is working fine or not... I have .sh script like below and i have servers.txt contains all the list of servers #/bin/bash for host in $(cat... (3 Replies)
Discussion started by: sreeram4
3 Replies

9. Shell Programming and Scripting

Find active SSH servers w/ ssh keys on LAN

Hi, I am trying to complete my bash script in order to find which SSH servers on LAN are still active with the ssh keys, but i am frozen at this step: #!/bin/bash # LAN SSH KEYS DISCOVERY SCRIPT </etc/passwd \ grep /bin/bash | cut -d: -f6 | sudo xargs -i -- sh -c ' && cat... (11 Replies)
Discussion started by: syrius
11 Replies
INOTICOMING(1)							    INOTICOMING 						    INOTICOMING(1)

NAME
inoticoming - trigger actions when files hit an incoming directory SYNOPSIS
inoticoming [ global-options ] directory actions* DESCRIPTION
Inoticoming is a daemon to watch a directory with Linux's inotify framework and trigger actions once files with specific names are placed in there. For example it can be used to wait for .changes files uploaded into a directory and call reprepro to put them into your repository. GLOBAL OPTIONS
--foreground Do not fork, but stay in the foreground and log to stderr. --logfile filename After forking in the background, log to the specified filename instead of syslog. --pid-file filename Write the pid of the running instance into filename. --initialsearch First search the directory for files already existing and process them with the given rules as if they just appeared. If files show up in this inital phase, they may be processed twice, but should never be missed. (Unless they are too many and the inotify queue overflows). ACTIONS
Each action description is an optional list of options for this action (which files to call it for, what directory to change into before executing it, ...), followed by the command and its arguments ended with a single ; as argument. Like: inoticoming --foreground / --regexp ^v echo There appeared {} in the root directory. ; (Note that the before the ; is needed if and only if you calling it from a shell or anything else interpreting the ; on its own). ACTION OPTIONS --prefix string Only trigger this action, if the filename starts with the specified string. --suffix string Only trigger this action, if the filename ends with the specified string. --regexp regular expression Only trigger this action, if the filename matches the specified regular expression. --chdir directory Change into directory before executing the specified commands. (Note that since it is a well-behaved daemon, its working directory is / which will be inherited by all actions). --stdout-to-log Redirect the command's output (stdout) to the logfile. --stderr-to-log Redirect the command's error output (stderr) to the logfile. EXAMPLES
inoticoming --logfile logs/ilog --pid-file pid $INCOMINGDIR --suffix .changes --stderr-to-log reprepro -s -b $REPREPROBASEDIR --waitforlock 1000 processincoming rulename {} ; This will call reprepro for every new .changes file. Note that giving {} as argument to processincoming (which inoticoming will replace with the filename) so that only that .changes file is processed and reprepro will not complain about a possible other yet incomplete .changes file is only available starting with reprepro version 2.2.2. PROBLEMS
There is no handling of queue overflows yet. REPORTING BUGS
Report bugs or wishlist requests to the Debian BTS (e.g. by using reportbug inoticoming under Debian) or directly to <brlink@debian.org>. COPYRIGHT
Copyright (C) 2007 Bernhard R. Link This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. inoticoming 2007-08-18 INOTICOMING(1)
All times are GMT -4. The time now is 09:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy