I have been keeping the code for my 'bot on my Ubuntu laptop, updating it from my iMac, and then running a Python script to FTP it to the RPi. Once major problem with this is that sometimes I will make a change and forget to run the update and then wonder at the abstinence of the 'bot to have changed it's behavior!
I could simply cron the script to run every how often but this didn't feel very eloquent especially as the copy includes everything whether it has changed or not. So not that my solution is terribly eloquent but I decided to write a quick script to only move code that has been changed and then put this inside a 15 second iteration loop.
I have one big try statement as my assumption is that a failure means the RPi is not online and that I should try later.
Code for "Crude FTP Update"
No comments:
Post a Comment