[reSOLVED ? -- see below. May not be "best" practice, but works]
I have to programmatically transfer .TXT files to a remote machine. What are best practices?
[EDIT]
Do this using rsync ssh. Setting public/private key will circumvent the need to type password. On your LOCAL machine
-
bash the following line:
ssh-keygen -t rsa
-
Hit ENTER 3 times (set file location, passphrase, confirm passphrase)
-
bash the following line:
ssh-copy-id -i ~/.ssh/id_rsa.pub *userID*@ssh.pythonanywhere.com
You should now be able to run passwordless rsync. The rsync command looks like:
rsync -avzhe ssh *userID*@ssh.pythonanywhere.com:/home/*userID*/*somefile* *LOCAL_DIRECTORY*
Once you know that it runs, create a script file on your LOCAL machine like this:
#!/bin/sh
rsync -avzhe ssh *userID*@ssh.pythonanywhere.com:/home/*userID*/*somefile* *LOCAL_DIRECTORY*
Save and CRON the script.