Re: running ssh/remote cmd in the background

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/26/17 18:08, bruce wrote:
Morn guys...

The following works as a test ssh to fire off a remote cmd. However it
waits for the cmd to complete befor returning. I'm looking to run th
cmd as a background on the local/calling instance. Ultimaely, I'll be
testing this from py/php scripts.

ssh -t user1@67.205.151.05 'cat /cloud/hash2.dat | wc -l'

-would the following work?

ssh -t user1@67.205.151.05 'cat /cloud/hash2.dat | wc -l' &

It runs the (complete) local ssh cmd (including it's parameters) locally in background. If you want to run the remote cmd in background (cat /cloud/hash2.dat | wc -l) you must add the "&" before the closing "'" and not after.

But this means your ssh command likely may exit before the remote cmd finishes. Is this reasonable?

Kind regards

Joachim Backes


Im not sure if the "&" would be applied to the remote or local side
for the ssh. And yeah, I know I could run a few tests... but I thought
I'd get the opinion of some of you guys as well...!!

Thanks
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx



--

Fedora release 25 (Twenty Five)
Kernel-4.9.12-200.fc25.x86_64


Joachim Backes <joachim.backes@xxxxxxxxxxxxxx>
https://www-user.rhrk.uni-kl.de/~backes/
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux