Cronjob - Optimize mySQL database

Can someone explain how to make a cronjob to optimize a mysql database everyday? I am a beginner to crons, so I am lost pretty much. I have a phpBB forum, and manually optimize the table by logging into phpMyAdmin every night. It would be a lot easier if I could set it up to do this automatically!

I’d appreciate any help with this!

Save $55 with Dreamhost! Just use coupon code: 55FREE

mysqlcheck -o -v -u [color=#00CC00][user][/color] -p[color=#0000CC][pass][/color] -h [color=#CC0000][mysql.hostname][/color] [databasename]

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost