This runs as a weelky Maintanace Plan but I am not sure what it actually does. Any clues?
declare @dt datetime
select @dt = getdate()-30
exec msdb.dbo.sp_delete_backuphistory @dt
EXEC msdb.dbo.sp_purge_jobhistory @oldest_date=@dt
EXECUTE msdb..sp_maintplan_delete_log null,null,@dt