I recently added an "auto delete old log files" feature to one of my plugins. It took a little while to get my head around the API, but it wasn't that bad for me.
In my "activate" I added
In my "deactivate"
wp_schedule_event(time(), 'daily', 'er_cron_del_hook')
add an action
and write the function
$cron_del_limiter = get_option('er_do_cron_del');
if ( ($cron_del_limiter == 'month') || ($cron_del_limiter == 'week') )
$curr_time = time();
$cron_file_age = 31536000; // default 1 year should be way more than enough
if ($cron_del_limiter == 'month') $cron_file_age = 2678400;
if ($cron_del_limiter == 'week') $cron_file_age = 604800;
// do file delete stuff if conditional tests pass