Skip to content

Commit 261b819

Browse files
committed
check for quiet rake job
Issue: #43
1 parent 5da02d8 commit 261b819

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Synopsis
88

9-
A script to use omnibus-gitlab's own backup ```gitlab-rake``` command on a cron schedule and rsync to another server, if wanted. Also, you can copy backups to [Backblaze’s B2 Cloud Storage service.](https://www.backblaze.com/b2/cloud-storage.html) There is also a restore script available (see below.)
9+
A simple script to backup your Gitlab data. This script will copy the backup archives of your gitlab installation via rsync, or scp. Also, you can copy backups to [Backblaze’s B2 Cloud Storage service.](https://www.backblaze.com/b2/cloud-storage.html) There is also a restore script available (see below.)
1010

1111
It can backup and copy the ```gitlab.rb``` config file, if configured.
1212

@@ -18,6 +18,8 @@ This script is now more omnibus-gitlab centric. Compare your config file with th
1818

1919
Deploy a working GitLab Omnibus installation and verify you can back it up with the rake task as documented in the [GitLab Documents](http://doc.gitlab.com/ce/raketasks/backup_restore.html).
2020

21+
For Backblaze usage, configure your system for the [Backblaze Command-Line Tool](https://www.backblaze.com/b2/docs/quick_command_line.html) Also, see the [wiki page on B2](https://github.com/sund/auto-gitlab-backup/wiki/Backblaze-B2-Command-Line-Tool).
22+
2123
#### Set up gitlab to expire backups
2224

2325
Change ```/etc/gitlab/gitlab.rb``` to expire backups
@@ -66,6 +68,10 @@ remoteDest="/var/opt/gitlab/backups"
6668
# change to 1 to enable
6769
backupConfigs=“0”
6870

71+
## rake quietly
72+
# change to 1 to enable quiet rake job
73+
quietRake=0
74+
6975
## enable backblaze b2 sync
7076
# change to 1 to enable
7177
# and set bucket name
@@ -126,3 +132,11 @@ Example for crontab to run at 5:05am everyday.
126132
*Still under development but useful*
127133

128134
run ```./restoreGitLab.sh -r``` and it will attempt to restore a backup. You may have to run some rake commands manually.
135+
136+
## Help
137+
138+
See the [Wiki](https://github.com/sund/auto-gitlab-backup/wiki) for more detailed instructions or submit a [Issue](https://github.com/sund/auto-gitlab-backup/issues).
139+
140+
## Contribute
141+
142+
See [Contribution Guide](https://github.com/sund/auto-gitlab-backup/blob/master/CONTRIBUTING.md) to improve this script.

auto-gitlab-backup.conf.sample

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ remoteDest="/var/opt/gitlab/backups"
1616
# change to 1 to enable
1717
backupConfigs="0"
1818

19+
## rake quietly
20+
# change to 1 to enable quiet rake job
21+
quietRake=0
22+
1923
## enable backblaze b2 sync
2024
# change to 1 to enable
2125
# and set bucketname

auto-gitlab-backup.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ gitlab_rails="/opt/gitlab/embedded/service/gitlab-rails"
4141
PDIR=$(dirname $(readlink -f $0))
4242
dateStamp=`date +"%F %H:%m:%S"`
4343
confFile="$PDIR/auto-gitlab-backup.conf"
44-
rakeBackup="gitlab-rake gitlab:backup:create"
44+
if [[ $quietRake == 1 ]]
45+
then
46+
rakeBackup="gitlab-rake gitlab:backup:create CRON=1"
47+
else
48+
rakeBackup="gitlab-rake gitlab:backup:create"
49+
fi
4550

4651
###
4752
## Functions

0 commit comments

Comments
 (0)