You want the Setting up a cron task doc.