Implement move result code check for recordings (#467)

Add error handling for file move operation.
This commit is contained in:
Antonio Fernandez
2026-04-10 18:11:43 -04:00
committed by GitHub
parent 2e68b248cb
commit c97579ab69

View File

@@ -156,7 +156,13 @@ crontab -e
if (!file_exists($new_path)) { system('mkdir -p '.$new_path); }
$command = "mv ".$old_path."/".$record_name." ".$new_path."/".$record_name;
if ($debug) { echo $command."\n"; }
system($command);
system($command, $move_result_code);
//skip the database update if the move failed
if ($move_result_code !== 0) {
if ($debug) { echo "mv failed with exit code ".$move_result_code.", skipping database update.\n"; }
continue;
}
}
//update the database to the new directory