Python converted from /bin/sh shell - backup script.

Hello, I have a shell script I wrote in /bin/sh to backup my web sever. I am now on a host (someone reselling rackspace server hosting to me) and when setting up cron, it actually has a dropdown list of "command languages" that you have to choose from.

my options are:

  • ruby
  • php
  • perl
  • python
  • http

mine is written in /bin/sh, so now I have to rewrite it in a different language. i recently started learning python, but got cut-off (w/a c++ class) so I never learned about writing/reading files, folders etc. (critical stuff, atleast for my script).

Could someone help me convert this to python, just pick any lines, convert it, and leave it here... i'm sure eventually - after enough ppl - it'll be converted. then everyone can benefit :slight_smile:

the original is attached.

I would at least convert some of it myself into python, but this would be the *first* thing i'd be writing in python and I honestly don't know where to start.

any help would be a great favor, thanks. :slight_smile: