Create a new file at
customExtensionmodulesSchedulersExtScheduledTasks
Let it call โoutright_do_repair.phpโ
Content on this file
ย<?php
array_push($job_strings, โoutright_do_repairโ);
Now go to
customExtensionapplicationExtUtils.php
Create a new file , let it call โoutright_cron_utils.phpโ.

<?php
function outright_do_repair(){
require_once("modules/Administration/QuickRepairAndRebuild.php");
ย ย ย global $moduleList;
ย ย ย $repair = new RepairAndClear();
ย ย ย $repair->repairAndClearAll(array("clearAll"),$moduleList, true,false);
ย ย ย $exit_on_cleanup = true;
ย ย ย sugar_cleanup(false);
}
Now go to admin->Scheduler

Then create a new scheduler with created function and set the schedule time.