I normally use a bash script to grab all the files onto local machine and use glob
to process all the files. Just wondering what would be the best way to use python (instead of another bash script) to ssh into each server and process those files?
My current program runs as
for filename in glob.glob('*-err.txt'):
input_open = open (filename, 'rb')
for line in input_open:
do something
My files all have the ending -err.txt
and the directories where they reside in the remote server have the same name /documents/err/
. I am not able to install third party libraries as I don't have the permission.
UPDATE
I am trying to not to scp
the files from the server but to read it on the remote server instead..
I want to use a local python script LOCALLY to read in files on remote server.