Don't throw error is User is deleted mid-backup

Version 1.514


As some systems take quite a while to generate a single backup of all accounts, it's possible that the User might be deleted mid-run. In this case, DA would have thrown the error: ---- User deleteduser has unknown usertype <13:31:40> Cannot find /tmp/admin.123456/user.admin.deleteduser.tar.gz for upload. ---- and in some cases, we would not want the backup error to generate an error if we know we deleted the User. This change adds checks to see if the error is actual an error with a present User, or if the User was actually deleted, but only exempts the error is the User Selection method is "All Users" or "All Users except". Should a specfic User list be used and this account is missing an error will be generated. To confirm if a User is deleted, DA will check for the uid via the /etc/passwd file. It will also look for the directory /usr/local/directadmin/data/users/username If either exist, then the User was not deleted, and an error is thrown. If both are missing, then DA assumes the User was deleted, and in addition to the above usertype error, a message is added to the output: "Looks like the User was deleted mid-backup. Ignoring the error." and the result is a non-error, just extra text in the message. If you set the option to only send an email on backup errors, then no message/email would be generated.

Interested to try DirectAdmin? Get a 30-day Free Trial!