aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-04-23 13:53:04 +0200
committerGravatar Christian Hesse <mail@eworm.de>2024-04-23 14:22:29 +0200
commit5b1a34d66b9f48c2b4eaf0f9e957f807f09bfb2c (patch)
tree98abe01d22a4df5941da7955a7f914a9bf70f683
parent71516107eb12f8080b368dc800697d4095f70cb1 (diff)
backup-cloud: clean up and simplify code
-rw-r--r--backup-cloud.rsc11
1 files changed, 5 insertions, 6 deletions
diff --git a/backup-cloud.rsc b/backup-cloud.rsc
index 859ddc7..003c702 100644
--- a/backup-cloud.rsc
+++ b/backup-cloud.rsc
@@ -49,14 +49,13 @@
:execute {
:global BackupPassword;
- # we are not interested in output, but print is
- # required to fetch information from cloud
- /system/backup/cloud/print as-value;
+
+ :local Backup ([ /system/backup/cloud/find ]->0);
/file/add name="tmpfs/backup-cloud/status";
- :delay 20ms;
- :if ([ :len [ /system/backup/cloud/find ] ] > 0) do={
+
+ :if ([ :typeof $Backup ] = "id") do={
/system/backup/cloud/upload-file action=create-and-upload \
- password=$BackupPassword replace=[ get ([ find ]->0) name ];
+ password=$BackupPassword replace=$Backup;
} else={
/system/backup/cloud/upload-file action=create-and-upload \
password=$BackupPassword;