Commifreak / unraid-appdata.backup

UNRAID AppData backup plugin
17 stars 1 forks source link

Maybe the `$tempFolder` isn't created ?! #27

Closed realizelol closed 3 days ago

realizelol commented 2 months ago

I've had a lot of these errors in the past but haven't seen them quite a while. On Friday I did a BIOS update, so I have to reboot my server and the next backup -today- shows me the following 3 errors: got PHP error: 2 / file_put_contents(/tmp/appdata.backup/running): Failed to open stream: No such file or directory /usr/local/emhttp/plugins/appdata.backup/scripts/backup.php:34 with context: [] got PHP error: 2 / copy(/tmp/appdata.backup/ab.log): Failed to open stream: No such file or directory /usr/local/emhttp/plugins/appdata.backup/scripts/backup.php:376 with context: [] got PHP error: 2 / unlink(/tmp/appdata.backup/running): No such file or directory /usr/local/emhttp/plugins/appdata.backup/scripts/backup.php:397 with context: []

So it looks like there's a mkdir needed in between https://github.com/Commifreak/unraid-appdata.backup/blob/master/src/scripts/backup.php#L25 ?!

if (!is_dir(ABSettings::$tempFolder)) {
    mkdir(ABSettings::$tempFolder, 0777, false, null);
}

or with one more "notify-abort" step:

if (!is_dir(ABSettings::$tempFolder)) {
    if (!mkdir(ABSettings::$tempFolder, 0777, false, null)) {
        ABHelper::notify("Appdata Backup", "Couldn't create tempFolder", "Script execution aborted. Please retry.");
        exit;
    }
}

PS: In the past I had used a AMD "NUC" which has frozen about every 6hours to 5days.

Commifreak commented 3 days ago

Should be fixed with cc790451825e9dd8c3e7884e102efc8849ffdd68