cloud-backup: add configurable random delay

This commit is contained in:
Christian Hesse 2021-02-23 09:55:14 +01:00
parent 766a92a74b
commit 6770a15a7d
3 changed files with 10 additions and 1 deletions

View File

@ -11,16 +11,23 @@
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; } :while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
:global BackupPassword; :global BackupPassword;
:global BackupRandomDelay;
:global Identity; :global Identity;
:global DeviceInfo; :global DeviceInfo;
:global LogPrintExit2; :global LogPrintExit2;
:global RandomDelay;
:global ScriptFromTerminal;
:global SendNotification; :global SendNotification;
:global SymbolForNotification; :global SymbolForNotification;
:global WaitFullyConnected; :global WaitFullyConnected;
$WaitFullyConnected; $WaitFullyConnected;
:if ([ $ScriptFromTerminal $0 ] = false && $BackupRandomDelay > 0) do={
$RandomDelay $BackupRandomDelay;
}
:do { :do {
# we are not interested in output, but print is # we are not interested in output, but print is
# required to fetch information from cloud # required to fetch information from cloud

View File

@ -18,9 +18,10 @@ Just install the script:
Configuration Configuration
------------- -------------
The configuration goes to `global-config-overlay`, this is the only parameter: The configuration goes to `global-config-overlay`, these are the parameters:
* `BackupPassword`: password to encrypt the backup with * `BackupPassword`: password to encrypt the backup with
* `BackupRandomDelay`: delay up to amount of seconds when run from scheduler
Also notification settings are required for e-mail and telegram. Also notification settings are required for e-mail and telegram.

View File

@ -42,6 +42,7 @@
:global BackupSendBinary false; :global BackupSendBinary false;
:global BackupSendExport true; :global BackupSendExport true;
:global BackupPassword "v3ry-s3cr3t"; :global BackupPassword "v3ry-s3cr3t";
:global BackupRandomDelay 0;
# These addresses are used to send backup and config export files to. # These addresses are used to send backup and config export files to.
:global EmailBackupTo ""; :global EmailBackupTo "";
:global EmailBackupCc ""; :global EmailBackupCc "";