Yep, you can use cronjobs to run shell or Perl scripts for daily/weekly/monthly maintenance. Sometimes I use a batch file/sql file pair to clean up stuff...
Example
##############
# file1.batch
##############
use db_name;
# clean out stuff older than two weeks and
# run once a day
delete from table_name where to_days(now()) - to_days(date_field) > 14;
##############
# file1.sql
##############
mysql -t -u username -ppassword < file1.batch
# no spaces between -p and password
# downside of this is that password is hard-
# coded into the file but its quick and dirty
Then run ./file1.sql from the command line or set up a cronjob to execute file1.sql whenever you want. Also works great with perl scripts, especially for MAIL functions, provided you have DBI set up and all that
Kyuzo
Nou ga aru taka wa tsume o kakusu