aboutsummaryrefslogtreecommitdiffstats
path: root/email-backup
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-01-09 15:06:01 +0100
committerGravatar Christian Hesse <mail@eworm.de>2019-01-09 15:06:01 +0100
commit57d93aa7016439356dffd81ffa1600f360594d67 (patch)
treee52bc379e2ca0e18eac0cfbc58e7c07dcb0d766d /email-backup
parentfe34a80a3d39bdeedb32e0f6ddf9a742b75a648f (diff)
email-backup: be more verbose about attached files and secret key
Diffstat (limited to 'email-backup')
-rw-r--r--email-backup13
1 files changed, 9 insertions, 4 deletions
diff --git a/email-backup b/email-backup
index dad5b03..9dd4f51 100644
--- a/email-backup
+++ b/email-backup
@@ -22,6 +22,8 @@
# filename based on identity
:local FileName ($Identity . "." . $Domain);
:local CloudStatus $BackupCloud;
+:local BackupStatus $BackupSendBinary;
+:local ConfigStatus $BackupSendExport;
:local Attach [ :toarray "" ];
# get some system information
@@ -37,7 +39,8 @@
# attach to mail
:if ($BackupSendBinary = true) do={
- :set Attach ($Attach, ($FileName . ".backup"));
+ :set BackupStatus ($FileName . ".backup");
+ :set Attach ($Attach, $BackupStatus);
}
# upload to cloud
@@ -50,6 +53,7 @@
/ system backup cloud remove-file [ find ];
}
/ system backup cloud upload-file action=upload src-file=($FileName . ".backup");
+ :set CloudStatus [ / system backup cloud get [ find ] secret-download-key ];
} on-error={
:set CloudStatus "failed";
}
@@ -59,7 +63,8 @@
# create configuration export
:if ($BackupSendExport = true) do={
/ export terse file=$FileName;
- :set Attach ($Attach, ($FileName . ".rsc"));
+ :set ConfigStatus ($FileName . ".rsc");
+ :set Attach ($Attach, $ConfigStatus);
}
# send email with status and files
@@ -71,8 +76,8 @@
"Hostname: " . $Identity . "\n" . \
"Channel: " . $Channel . "\n" . \
"RouterOS: " . $InstalledVersion . "\n\n" . \
- "Backup attached: " . $BackupSendBinary . "\n" . \
- "Config attached: " . $BackupSendExport . "\n" . \
+ "Backup attached: " . $BackupStatus . "\n" . \
+ "Config attached: " . $ConfigStatus . "\n" . \
"Cloud backup: " . $CloudStatus) \
file=$Attach;
}