Skip to content

Commit

Permalink
- Fixed Array state detection - now works the Unraid way
Browse files Browse the repository at this point in the history
  • Loading branch information
Commifreak committed Jan 28, 2023
1 parent 4d8609e commit 6baf237
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions ca.backup2.plg
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<!DOCTYPE PLUGIN [
<!ENTITY name "ca.backup2">
<!ENTITY author "Robin Kluth">
<!ENTITY version "2023.01.11">
<!ENTITY md5 "380090359a8ced1f18b930c945a91a92">
<!ENTITY version "2023.01.28">
<!ENTITY md5 "4855fa5cba9d12754b42d55f56d9ee38">
<!ENTITY launch "Settings/BackupMainV2">
<!ENTITY plugdir "/usr/local/emhttp/plugins/&name;">
<!ENTITY github "Commifreak/ca.backup2">
Expand All @@ -14,6 +14,9 @@

<CHANGES>
<![CDATA[
###2023.01.28
- Fixed Array state detection - now works the Unraid way
###2023.01.11
- 🚀 Happy new year!
- Added an option, to disable backup error detection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ function backupLog($msg, $newLine = true, $skipDate = false)
file_put_contents($communityPaths['backupLog'], ($skipDate ? '' : "[" . date("d.m.Y H:i:s") . "]") . " $msg" . ($newLine ? "\n" : ''), FILE_APPEND);
}

if (!is_dir("/mnt/user")) {
logger("It doesn't appear that the array is running. Exiting CA Backup");
$emhttpVar = parse_ini_file('/var/local/emhttp/var.ini');
if (!$emhttpVar || $emhttpVar['fsState'] != 'Started') {
backupLog("It doesn't appear that the array is running. Exiting CA Backup");
notify("CA Backup", "appData backup", "Error occured!", "Array is not started! Not creating backup.", 'alert');
exit();
}

$backupOptions = readJsonFile($communityPaths['backupOptions']);
if (!$backupOptions) {
@unlink($communityPaths['backupProgress']);
Expand Down

0 comments on commit 6baf237

Please sign in to comment.