Hello sumit07, so as far as I understand the main communication between you and the program will be happening through server C's command line and that the actual interaction will be going on between servers A and B. A would be manipulating the files in B. The first thing I would suggest is setting up something to listen on server A for incomming messages from you (c). I am not sure if these servers are on the same machine or LAN though it would not really matter there is more than one way to do it anyway.

After you set up a socket to listen for messages on A, you can create a sort of opcode for each function you want executed... maybe you might say "delete filex.txt" on C and that would get sent to A, where a regex can check socket for relevant opcodes and you can preform the function to server B accordingly.

Now this is all assuming you know how to work with sockets but if you do not, there are some easy ways like IO::Socket::INET or you can simply use socket; and build one from scratch. I also do not know what kind of servers your running but for machine to machine communication definetly look at sockets. If they are all on the same machine take a look at piping and other forms of inter process communication.


In reply to Re: run perl script on remote server by Rudolf
in thread run perl script on remote server by sumit07

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.