aboutsummaryrefslogtreecommitdiffstats
path: root/backup-cloud
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-03-07 10:57:42 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-03-07 22:26:01 +0100
commita832fd04ef085ef7e85000843a8e8fa59ce36dfb (patch)
treec977ca4b5167d8aa07dbe6bfe15fca8f467db0d9 /backup-cloud
parent1e6e0646e256c4acb9f8470853d0699286af010e (diff)
rename scripts and add file extension ".rsc"change-95
No functional change for the user... The migration is done automatically.
Diffstat (limited to 'backup-cloud')
-rw-r--r--backup-cloud57
1 files changed, 1 insertions, 56 deletions
diff --git a/backup-cloud b/backup-cloud
index b75d5cb..2da00ca 100644
--- a/backup-cloud
+++ b/backup-cloud
@@ -1,58 +1,3 @@
#!rsc by RouterOS
-# RouterOS script: backup-cloud
-# Copyright (c) 2013-2023 Christian Hesse <mail@eworm.de>
-# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
#
-# provides: backup-script
-#
-# upload backup to MikroTik cloud
-# https://git.eworm.de/cgit/routeros-scripts/about/doc/backup-cloud.md
-
-:local 0 "backup-cloud";
-:global GlobalFunctionsReady;
-:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
-
-:global BackupPassword;
-:global BackupRandomDelay;
-:global Identity;
-
-:global DeviceInfo;
-:global LogPrintExit2;
-:global RandomDelay;
-:global ScriptFromTerminal;
-:global SendNotification2;
-:global SymbolForNotification;
-:global WaitFullyConnected;
-
-$WaitFullyConnected;
-
-:if ([ $ScriptFromTerminal $0 ] = false && $BackupRandomDelay > 0) do={
- $RandomDelay $BackupRandomDelay;
-}
-
-:do {
- # we are not interested in output, but print is
- # required to fetch information from cloud
- /system/backup/cloud/print as-value;
- :if ([ :len [ /system/backup/cloud/find ] ] > 0) do={
- /system/backup/cloud/upload-file action=create-and-upload \
- password=$BackupPassword replace=[ get ([ find ]->0) name ];
- } else={
- /system/backup/cloud/upload-file action=create-and-upload \
- password=$BackupPassword;
- }
- :local Cloud [ /system/backup/cloud/get ([ find ]->0) ];
-
- $SendNotification2 ({ origin=$0; \
- subject=([ $SymbolForNotification "floppy-disk,cloud" ] . "Cloud backup"); \
- message=("Uploaded backup for " . $Identity . " to cloud.\n\n" . \
- [ $DeviceInfo ] . "\n\n" . \
- "Name: " . $Cloud->"name" . "\n" . \
- "Size: " . $Cloud->"size" . " B (" . ($Cloud->"size" / 1024) . " KiB)\n" . \
- "Download key: " . $Cloud->"secret-download-key"); silent=true });
-} on-error={
- $SendNotification2 ({ origin=$0; \
- subject=([ $SymbolForNotification "floppy-disk,warning-sign" ] . "Cloud backup failed"); \
- message=("Failed uploading backup for " . $Identity . " to cloud!\n\n" . [ $DeviceInfo ]) });
- $LogPrintExit2 error $0 ("Failed uploading backup for " . $Identity . " to cloud!") true;
-}
+# dummy for migration