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.