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โ€.

Scheduled Job by code

<?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.