forked from norman/fusionpbx-install.sh-github-mirror
Implement move result code check for recordings (#467)
Add error handling for file move operation.
This commit is contained in:
committed by
GitHub
parent
2e68b248cb
commit
c97579ab69
@@ -156,7 +156,13 @@ crontab -e
|
|||||||
if (!file_exists($new_path)) { system('mkdir -p '.$new_path); }
|
if (!file_exists($new_path)) { system('mkdir -p '.$new_path); }
|
||||||
$command = "mv ".$old_path."/".$record_name." ".$new_path."/".$record_name;
|
$command = "mv ".$old_path."/".$record_name." ".$new_path."/".$record_name;
|
||||||
if ($debug) { echo $command."\n"; }
|
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
|
//update the database to the new directory
|
||||||
|
|||||||
Reference in New Issue
Block a user