cLive ;-) has asked for the wisdom of the Perl Monks concerning the following question:
Has anyone encountered anything similar? If I ssh in manually and run the command, it works ok, though I do need to hit enter twice on running to get back to the shell.my @hosts=( list of hosts here ); for (@hosts) { print "Running on $_...\n"; print `scp script.pl $_:~/`; print `ssh $_ "nohup nice perl script.pl &"`; }
Hmmm, maybe I need to use Expect.
Ack. Any thoughts?
cLive ;-)
Update 2004-04-19: found the solution in the ssh FAQ:
print `ssh $_ "nohup nice perl script.pl < /dev/null > /dev/null 2>&1 +&"`;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Slightly OT - automating nohup bg jobs...
by jonadab (Parson) on Jan 21, 2004 at 01:06 UTC | |
|
Re: Slightly OT - automating nohup bg jobs...
by bluto (Curate) on Jan 21, 2004 at 17:49 UTC | |
by cLive ;-) (Prior) on Jan 23, 2004 at 06:28 UTC | |
by bluto (Curate) on Jan 23, 2004 at 16:19 UTC | |
by cLive ;-) (Prior) on Apr 20, 2004 at 00:20 UTC | |
by bluto (Curate) on Apr 20, 2004 at 13:43 UTC |