You are not logged in.
Okay here's the scenario: two servers, A and B. I need to run a python-script from server A that checks if a specific file exists on a path on server B. I can easily enough do this locally, but how do I do it across two servers that are not physically connected?
If it helps, both servers are set up with ssh-keys.
Any help greatly appreciated.
Offline
You can run commands with ssh e.g.:
ssh user@server 'file-checking script'
Offline
You can run commands with ssh e.g.:
ssh user@server 'file-checking script'
Ah, but then the script needs to be located on the remote server, right?
Offline
Well, you can easily check for a file using bash and standard GNU tools, which should exist on the remote server if it is running *nix.
Offline
ssh user@server '[[ -f /path/to/file ]]'
Check the exit status.
type 'help test' in bash to see all options.
Offline