Skip to main content
added 183 characters in body
Source Link
puma
  • 11
  • 3

You can do this with

ssh user@server "python script.py"
scp user@server:/remote/file.txt /local/directory

This executes the script on the remote machine, providing you have the proper ip address and filepaths, and will then copy the file from the remote machine to yours.

You could also execute the script using a cron job on the remote machine if you would like to look into it

EDIT: There is no need to actually exit ssh, becuase this ssh command executes the command, but does not establish a running shell, you can test this by running ssh localhost ls

You can do this with

ssh user@server "python script.py"
scp user@server:/remote/file.txt /local/directory

This executes the script on the remote machine, providing you have the proper ip address and filepaths, and will then copy the file from the remote machine to yours.

You could also execute the script using a cron job on the remote machine if you would like to look into it

You can do this with

ssh user@server "python script.py"
scp user@server:/remote/file.txt /local/directory

This executes the script on the remote machine, providing you have the proper ip address and filepaths, and will then copy the file from the remote machine to yours.

You could also execute the script using a cron job on the remote machine if you would like to look into it

EDIT: There is no need to actually exit ssh, becuase this ssh command executes the command, but does not establish a running shell, you can test this by running ssh localhost ls

Source Link
puma
  • 11
  • 3

You can do this with

ssh user@server "python script.py"
scp user@server:/remote/file.txt /local/directory

This executes the script on the remote machine, providing you have the proper ip address and filepaths, and will then copy the file from the remote machine to yours.

You could also execute the script using a cron job on the remote machine if you would like to look into it