backup-email: wait for the mail to be sent

This commit is contained in:
Christian Hesse 2023-02-02 11:49:01 +01:00
parent c47c9a2906
commit 490a738af1
1 changed files with 10 additions and 0 deletions

View File

@ -83,3 +83,13 @@ $SendEMail2 ({ origin=$0; \
"Backup file: " . $BackupFile . "\n" . \
"Config file: " . $ConfigFile); \
attach=$Attach; remove-attach=true });
# wait for the mail to be sent
:local I 0;
:while ([ :len [ /file/find where name ~ ($FilePath . "\\.(backup|rsc)\$") ] ] > 0) do={
:if ($I >= 120) do={
$LogPrintExit2 warning $0 ("Files are still available, sending e-mail failed.") true;
}
:delay 1s;
:set I ($I + 1);
}