开发者

How do I execute a Perl program on a remote machine?

开发者 https://www.devze.com 2023-01-12 08:58 出处:网络
I wrote a Perl program to capture a live data stream from a tail command on a Linux machine using the following command in the console:

I wrote a Perl program to capture a live data stream from a tail command on a Linux machine using the following command in the console:

tail -f xyz.log | myperl.pl

It works fine. But now I have to execute this Pe开发者_JS百科rl program on a different machine because the log file is on that different machine. Can anyone tell me how I can do it?


You could say

ssh remotemachine tail -f xyz.log | myperl.pl

I suppose or maybe mount the remote log directories locally onto your administrative machine and do the processing there.


Or you could even say

ssh remotemachine bash -c "tail -f xyz.log | myperl.pl"

in order to run the script on the remote machine (if your script produces some output files and you want them on remote machine)

0

精彩评论

暂无评论...
验证码 换一张
取 消