1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

upload-backup: add configurable random delay

This commit is contained in:
Christian Hesse
2021-02-23 09:56:28 +01:00
parent 8b44964a36
commit bc8b19fc31
2 changed files with 10 additions and 2 deletions

View File

@@ -11,6 +11,7 @@
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
:global BackupPassword;
:global BackupRandomDelay;
:global BackupSendBinary;
:global BackupSendExport;
:global BackupUploadPass;
@@ -23,18 +24,24 @@
:global DeviceInfo;
:global IfThenElse;
:global LogPrintExit2;
:global RandomDelay;
:global ScriptFromTerminal;
:global SendNotification;
:global SymbolForNotification;
:global WaitForFile;
:global WaitFullyConnected;
$WaitFullyConnected;
:if ($BackupSendBinary != true && \
$BackupSendExport != true) do={
$LogPrintExit2 error $0 ("Configured to send neither backup nor config export.") true;
}
$WaitFullyConnected;
:if ([ $ScriptFromTerminal $0 ] = false && $BackupRandomDelay > 0) do={
$RandomDelay $BackupRandomDelay;
}
# filename based on identity
:local FileName [ $CharacterReplace ($Identity . "." . $Domain) "." "_" ];
:local BackupFile "none";