As you should be well aware by now, you can use PHP as a command-line scripting system to automate common tasks. We look at this in more depth later as we explore some of the alternative things you can do with command-line PHP. ...
A very well written guide that I found more useful than the PHP Manual.