There are multiple way of doing this, some have security issues. For example, it is trivial to use SSH to execute a script remotely (see responses after the first here) but then you would need to put your password into the command which exposes it to anyone who can read that file (and therefore the safety of both servers is tied, one goes means both go). A safer method of doing the same thing is by setting up passwordless authentication for SSH and use the "command" option to run your script you have above, see here for that option. This is probably the best alternative. Another method is to modify your script above to output the result to some file (pretty trivial) and download it on the other server.