-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from sund/develop
Merge in Develop to Master for Milestone 1.6
- Loading branch information
Showing
5 changed files
with
122 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
## auto gitlab Backup | ||
# Auto GitLab Backup | ||
|
||
http://sund.la/glup | ||
[![AGB Logo](https://raw.githubusercontent.com/sund/auto-gitlab-backup/develop/agb_logo.png)](http://sund.la/glup) | ||
|
||
---- | ||
|
||
## Synopsis | ||
|
||
A script to use omnibus-gitlab's own backup ```gitlab-rake``` command on a cron schedule and rsync to another server, if wanted. There is also a restore script available (see below.) | ||
|
||
It can backup and copy the Gitlab-CI DB, if configured. | ||
|
||
This script is now more omnibus-gitlab centric. Compare your config file with the template! Usage with a source install is possible but not expressly shown here. | ||
|
||
#### Clone | ||
## Installation | ||
|
||
### Prerequisites | ||
|
||
clone to your directory of choice. I usually use ```/usr/local/sbin``` | ||
Deploy a working GitLab 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). | ||
|
||
#### Set up gitlab to expire backups | ||
|
||
|
@@ -33,7 +37,19 @@ If you use the CI server, enable CI Backup expiration | |
gitlab_ci['backup_keep_time'] = 604800 | ||
``` | ||
|
||
#### Configure the script for remote copy | ||
### Installation | ||
|
||
Clone to your directory of choice. I usually use ```/usr/local/sbin``` | ||
|
||
``` | ||
git clone [email protected]:sund/auto-gitlab-backup.git | ||
``` | ||
|
||
### Updates | ||
|
||
Compare the ```auto-gitlab-backup.conf.sample``` file with your own copy. Make changes as needed to ensure no errors are encountered. | ||
|
||
### Configure | ||
|
||
```bash | ||
cp auto-gitlab-backup.conf.sample auto-gitlab-backup.conf | ||
|
@@ -54,14 +70,21 @@ remoteServer="" | |
sshKeyPath="" | ||
|
||
## $remoteServer path for gitlab backups | ||
remoteDest="" | ||
|
||
## Using the CI server? | ||
# change to true or 1 to enable CI backups | ||
enableCIBackup="0" | ||
|
||
## $remoteServer dest for CI backups on remote | ||
ciRemoteDest="/var/opt/gitlab/ci-backups" | ||
remoteDest="/var/opt/gitlab/backups" | ||
|
||
## set $localConfDir | ||
# blank disables conf backups | ||
# you can create /var/opt/gitlab/backups/configBackups -- | ||
# gitlab doesn't seem to complain with a subfolder | ||
# in there. Plus it will rsync up with the backup. | ||
# So you won't need to enable a separate rsync run | ||
localConfDir="/var/opt/gitlab/backups/configBackups" | ||
|
||
## set $remoteServer path for gitlab configs | ||
# blank disables remote copy | ||
# unless $localConfDir is outside /var/opt/gitlab/backups/configBackups | ||
# you can leave this blank | ||
remoteConfDest="" | ||
|
||
## ssh port or 873 for rsyncd port | ||
remotePort=22 | ||
|
@@ -78,20 +101,25 @@ RVM_envPath="" | |
remoteModule="" | ||
rsync_password_file="" | ||
|
||
## only change if configs are in different locations. (unlikely) | ||
localConfig="/etc/gitlab" | ||
localsshkeys="/var/opt/gitlab/.ssh" | ||
|
||
## Check remote quota | ||
# change to true or 1 to enable | ||
checkQuota="0" | ||
|
||
``` | ||
|
||
#### cron settings | ||
### cron settings | ||
|
||
Example for crontab to run at 5:05am everyday. | ||
|
||
```bash | ||
5 5 * * * /usr/local/sbin/auto-gitlab-backup/auto-gitlab-backup.sh | ||
``` | ||
|
||
## restore a backup | ||
## Restore | ||
|
||
*Still under development but useful* | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters