Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuietRake option does not work #55

Open
klasyc opened this issue Nov 1, 2021 · 1 comment
Open

QuietRake option does not work #55

klasyc opened this issue Nov 1, 2021 · 1 comment

Comments

@klasyc
Copy link
Contributor

klasyc commented Nov 1, 2021

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!

@sund
Copy link
Owner

sund commented Nov 2, 2021

Thanks for the patch! Feel free to push a Pull Request.
I have changed jobs so I haven't used this script for quite a while. If anyone would like to take over this, I would be glad to discuss it. Otherwise, this may be archived due to it no longer being relevant to my work.

klasyc added a commit to klasyc/auto-gitlab-backup that referenced this issue Nov 3, 2021
sund added a commit that referenced this issue Nov 19, 2021
fix(#55): Fix quietRake configuration option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants