public static function handleJobFinished(BatchJob $job, kScheduledTaskJobData $data) { $resultFilePath = $data->getResultsFilePath(); if (!file_exists($resultFilePath)) { return self::finishJobWithError($job, 'Results file was not found'); } // we are using the bulk upload sync key, as this should actually be a generic sync key for batch job object $syncKey = $job->getSyncKey(BatchJob::FILE_SYNC_BATCHJOB_SUB_TYPE_BULKUPLOAD); try { kFileSyncUtils::moveFromFile($resultFilePath, $syncKey, true); } catch (Exception $ex) { KalturaLog::err($ex); return self::finishJobWithError($job, 'Failed to move file: ' . $ex->getMessage()); } return $job; }