The biggest complaint I hear from people who use MySQL driven sites on inexpensive shared hosting services is a decrease in performance over time. Most of the time this decrease is no fault of your hosting provider, but the cluttering of your database.
Like any computer storage device, a database is simply a collection of data that through time, use, and abuse can grow unorganized and cluttered. I uncovered a few scripts people had written in this article at noupe.com. Not only did I want to have my databases optimized, I also wanted the backups to be created. So what I have in for your enjoyment is a script that will optimize your database, backup the database to a file including the timestamp (to avoid overwriting), and it will also email you upon warnings and errors.
To install this script you place it in a folder that you can call something like ‘supersecretfoldername’ and put a password on this folder. When the script is run it places a backup in a folder named ‘_db_backups’ in the directory parent to the ‘supersecretfoldername’ folder.
As a bonus, if you use this in conjunction with GoDaddy hosting services, you can use this as a Cron Script to be run without your interaction and the backups will be in GoDaddy’s default database backup folder. GoDaddy’s Hosting Control Center will also email you the script results as part of their Cron Manager interface.
Download the script.
If you are using GoDaddy you will want to set the file permissions to ‘Executable’ through their ‘File Manager’ (Help Article). You can then use the ‘Cron Manager’ from within the ‘Content’ section of your Hosting Control Center. Here you can set the email address they will send your results to, your scripts, and their frequency

{ 1 comment… read it below or add one }
This is awesome. Especially since the ‘official’ stance with the hosting provider mentioned is, ‘it can’t be done.’ Good job.