aboutsummaryrefslogtreecommitdiffstats
path: root/backup-cloud.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-03-06 15:28:55 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-03-12 15:27:15 +0100
commit15c68c5660ab6bc0af4c9dee4de7b74ebcf0abb8 (patch)
treed9b8926ee39c29eb21deda5ace941d6e67b8e3b1 /backup-cloud.rsc
parentd0af9d62ea6bd3b749d717f223ee424d5962c2af (diff)
backup-cloud: drop main function, use :do with on-error
Diffstat (limited to 'backup-cloud.rsc')
-rw-r--r--backup-cloud.rsc10
1 files changed, 4 insertions, 6 deletions
diff --git a/backup-cloud.rsc b/backup-cloud.rsc
index 2846d75..a3dfe0c 100644
--- a/backup-cloud.rsc
+++ b/backup-cloud.rsc
@@ -12,8 +12,8 @@
:global GlobalFunctionsReady;
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
-:local Main do={
- :local ScriptName [ :tostr $1 ];
+:do {
+ :local ScriptName [ :jobname ];
:global BackupRandomDelay;
:global Identity;
@@ -32,7 +32,7 @@
:global WaitFullyConnected;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :return false;
+ :error false;
}
$WaitFullyConnected;
@@ -77,6 +77,4 @@
$LogPrintExit2 error $ScriptName ("Failed uploading backup for " . $Identity . " to cloud!") true;
}
/file/remove "tmpfs/backup-cloud";
-}
-
-$Main [ :jobname ];
+} on-error={ }