File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ sshKeyPath=""
1212## $remoteServer path for gitlab backups
1313remoteDest="/var/opt/gitlab/backups"
1414
15+ ## backup gitlab configs
16+ # change to 1 to enable
17+ backupConfigs="0"
18+
1519## set $localConfDir
1620# blank disables conf backups
1721# you can create /var/opt/gitlab/backups/configBackups --
Original file line number Diff line number Diff line change @@ -75,15 +75,15 @@ checkSize() {
7575
7676archiveConfig () {
7777 echo ===== Archiving Configs =====
78- if [ -w $localConfDir ]
78+ if [[ -w $localConfDir && $backupConfigs = 1 ] ]
7979 then
8080 tar -czf " $localConfDir /gitlabConf-$dateStamp .tgz" $localConfig $localsshkeys
8181
8282 # remove files not within 3 days
8383 find $localConfDir -type f -mtime +3 -exec rm {} \;
8484
8585 else
86- echo " Local configs aren't enabled or $localConfDir is not writable."
86+ echo " Local config backup aren't enabled or $localConfDir is not writable."
8787 fi
8888}
8989
@@ -328,6 +328,7 @@ case $1 in
328328 -d|--dry-run )
329329 areWeRoot $1
330330 confFileExist
331+ archiveConfig
331332 # #test ssh and rsync functions
332333 if [[ $remoteModule != " " ]]
333334 then
You can’t perform that action at this time.
0 commit comments