function lib_scheduling_log($cat, $msg) { file_put_contents(lib_scheduling_config('logs-path'), '' . date('Y-m-d H:i:s') . ' - ' . $cat . ' - ' . $msg . "\n", FILE_APPEND); }
if ($err) { lib_scheduling_warning('Scheduler::job_perform[wait]{rsync: ' . $cmd . '}(' . $err . ') |::>' . implode("\n", $out) . ' <::|'); sleep(600); } else { break; } } // Retrieve fail if ($err) { lib_scheduling_error('Scheduler::job_perform[fail]{rsync: ' . $cmd . '}(' . $err . ') |::>' . implode("\n", $out) . ' <::|'); lib_scheduling_file_move(lib_scheduling_config('processing-path') . '/' . $job['basename'], lib_scheduling_config('failed-path') . '/' . $job['basename']); die; } // Retrieve Success lib_scheduling_job_metadata_set($job, 'done', date('Y-m-d H:i:s'), lib_scheduling_config('processing-path')); lib_scheduling_file_move(lib_scheduling_config('processing-path') . '/' . $job['basename'], lib_scheduling_config('processed-path') . '/' . $job['basename']); lib_scheduling_file_move($job['location'], $render_finished_upload_dir . '/' . $job_dir); // Now that the files have been copied on EZcast server, we delete them from EZrenderer if ($renderer['processed_dir'] . '/' . $job_dir != '' && $renderer['processed_dir'] . '/' . $job_dir != '/') { $cmd = $ssh_pgm . ' ' . $renderer['client'] . '@' . $renderer['host'] . ' " rm -rf ' . $renderer['processed_dir'] . '/' . $job_dir . ' 2>&1"'; exec($cmd, $out, $err); } // Now run cli_render_maminsert $cmd = "{$php_cli_cmd} cli_rendered_maminsert.php {$album} {$asset} {$render_finished_upload_dir}/{$job_dir} >> {$render_finished_upload_dir}/{$job_dir}/rendered_maminsert.log 2>&1"; exec($cmd, $cmdoutput, $returncode); if ($returncode) { //non zero return code -> something bad happened $msg = "Submit_intro_title_movie failed"; $asset_meta['status'] = 'failed'; $res = ezmam_asset_metadata_set($album, $asset, $asset_meta); } else {