one thing to remember is to terminate each query with a semi-colon ;
that is one thing that bit me when i was first trying it out..
i have a script that does that as a subset of other maintenance things like:
closing the board down temporarily by changing config.inc.php
optimizing ubbt_POSTS ubbt_TOPICS
archiving ubbt_POSTS table to ubbt_POSTS_ARCHIVE table for any 'old posts'
gziping all the changed tables..
re-opening the board
FTPing to my local HDD and rotating with backup name
the sky's the limit, really.. but you can then rest easier @ night if you know you have a backup.. especially if it is more than just one website that you have to maintain..