If you want to automate the maintenance of your Drupal sites the best tool is drush. It allows you to maintain modules, run sql queries, clear caches, show logs, run cron, and perform unit tests. Nothing more to say, but I only recently found this tool and if you love the command-line like I do this works like a charm.