From 490a738af12a0415da252441d50cbe29745a90ad Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 2 Feb 2023 11:49:01 +0100 Subject: backup-email: wait for the mail to be sent --- backup-email | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backup-email b/backup-email index 036c520..158e746 100644 --- a/backup-email +++ b/backup-email @@ -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); +} -- cgit v1.2.3-70-g09d2