I get sometimes errors when backing up my websites

Discussion in 'General' started by pkic, Feb 28, 2023.

  1. pkic

    pkic New Member

    I have sometimes received errors when backing up my websites (I use zip to back up websites). I am using ISPConfig 3.2.9, but this happened in earlier versions as well.
    This seems to be similar to this issue: "I get some ERRORS after upgrading to ISPConfig 3.2" on this forum.

    After some testing, I discovered that my problem occurs when zip returns code 18, as here:
    Code:
    27.02.2023-04:12 - DEBUG - safe_exec cmd: cd '/var/www/clients/client20/web482 && zip  -b '/var/backup/tmp' --exclude='./backup\*' --exclude=./bin --exclude=./dev --exclude=./etc --exclude=./lib --exclude=./lib32 --exclude=./lib64 --exclude=./opt --exclude=./sys --exclude=./usr --exclude=./var --exclude=./proc --exclude=./run --exclude=./tmp --exclude=./log --symlinks -r '/var/backup/websites/web482/web482_2023-02-27_04-12.zip' * .* -x "../*" - return code: 18
    According to "man zip", this error code means "zip could not open a specified file to read".
    This is just a warning, and the zip file is created successfully.
    I suppose it happens when some files disappear during the backup process. I tested this manually (by deleting some files during the backup) and got the same warning.
    However, ISPConfig treats this error code as a real error and aborts the backup process.
    For testing purposes I changed /usr/local/ispconfig/server/lib/classes/backup.inc.php
    from:
    Code:
                    // zip can return 12 (due to harmless warnings) and still create valid backups
                   return ($exit_code == 0 || $exit_code == 12);
    
    to:
    Code:
                    // zip can return 12 or 18 (due to harmless warnings) and still create valid backups
                   return ($exit_code == 0 || $exit_code == 12 || $exit_code == 18);
    and now all my backups are created without any problems.

    Could you consider adding this "fix" to the official code, please?
     

Share This Page