A script to use gitlab's own backup rake command on a cron schedule and rsync to another server if wanted.
See the omnibus-master branch to use this with the gitlab-omnibus package.
clone to your directory of choice. I usually use /usr/local/sbin
Change config/gitlab.yml to expire backups
remove the # from keep_time
## Backup settings
backup:
path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/)
keep_time: 604800 # a week
# keep_time: 604800 # default: 0 (forever) (in seconds)cp auto-gitlab-backup.conf.sample auto-gitlab-backup.confedit auto-gitlab-backup.conf
remoteUser="" #user account on remote server
remoteServer="" #remote host
remoteDest="" #remote path
sshKeyPath="" #path to an alternate ssh key, if needed.
remotePort=22 # ssh port
## only use the below settings if your destination is using rsync in daemon mode
remoteModule=""
rsync_password_file=""Example for crontab to run at 5:05am everyday.
5 5 * * * /usr/local/sbin/auto-gitlab-backup/auto-gitlab-backup.shStill under development but useful
run ./restoreGitLab.sh -r and it will attempt to restore a backup. You may have to run some rake commands manually.