Skip to content

QuietRake option does not work #55

Description

@klasyc

When i set quietRake=1 option in the configuration file, it is simply ignored and rake still prints lots of debug messages. After a quick research it turned out that the rake command is generated before the configuration file is actually loaded. The fix seems to be very simple, look at my patch which solves the issue for me:

diff --git a/auto-gitlab-backup.sh b/auto-gitlab-backup.sh
index 0faddad..d50f67a 100755
--- a/auto-gitlab-backup.sh
+++ b/auto-gitlab-backup.sh
@@ -41,12 +41,6 @@ gitlab_rails="/opt/gitlab/embedded/service/gitlab-rails"
 PDIR=$(dirname $(readlink -f $0))
 dateStamp=`date +"%F %H:%m:%S"`
 confFile="$PDIR/auto-gitlab-backup.conf"
-if [[ $quietRake == 1 ]]
-then
-  rakeBackup="gitlab-rake gitlab:backup:create CRON=1"
-else
-  rakeBackup="gitlab-rake gitlab:backup:create"
-fi

 ###
 ## Functions
@@ -95,6 +89,14 @@ archiveConfig() {
 rakeBackup() {
     echo ===== raking a backup =====
     cd $gitRakeBackups
+
+    if [[ $quietRake == 1 ]]
+    then
+      rakeBackup="gitlab-rake gitlab:backup:create CRON=1"
+    else
+      rakeBackup="gitlab-rake gitlab:backup:create"
+    fi
+
     $rakeBackup
 }

Anyway, thank you for a useful script. It saves me a lot of time!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions