Shell Script for Incremental with Rotation?

Can anyone point me to a shell script example that could be used in conjunction with cron that would allow me to do hourly incremental backups of all tables and rotate at 24 (so I have a full day of hourly incremental backups.). Thanks!