Technically Feasible

PHP shell scripts for Magento

on inchoo.net

A very helpful guide to creating Magento shell scripts the correct way