]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
Fix: borg: exit code handling
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 13 Jul 2024 12:57:31 +0000 (09:57 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 13 Jul 2024 12:57:31 +0000 (09:57 -0300)
templates/borg.sh.erb

index 6519814a7ae1eaf371fa9f9944175857bb6f961a..ee248e6b0be4d477e25187d2250efe67d3643582 100644 (file)
@@ -82,7 +82,7 @@ borg create                          \
   <%= add %>                         \
 <% end -%>
 
-  backup_exit=$?
+backup_exit=$?
 
 #if [ "$backup_exit" != "0" ]; then
 #  fatal "Error creating snapshot"
@@ -105,7 +105,7 @@ borg prune                            \
   --keep-weekly   <%= @keepweekly %>  \
   --keep-monthly  <%= @keepmonthly %> \
 
-  prune_exit=$?
+prune_exit=$?
 
 #if [ "$prune_exit" != "0" ]; then
 #  fatal "Error pruning repository"
@@ -147,6 +147,8 @@ if [ "<%= @encryption %>" == "keyfile" ] && [ ! -z "<%= @keyfile %>" ]; then
 
     gpg_copy_exit=$?
   fi
+else
+  gpg_copy_exit=0
 fi
 
 # Use highest exit code as global exit code