Archive of posts: September 2016

article image

Gitlab Omnibus Maintenance Process

Maintenance process for gitlab/mattermost

Location for the backups: /backups Backing up: Just copy and paste this entire script cat << EOF | sudo bash #!/bin/bash function backup_gitlab { rm -f /var/opt/gitlab/backups/* gitlab-rake gitlab:backup:create mv /var/opt/gitlab/backups/* /backups } function backup_mattermost { # init rm -rf /tmp/mattermost || true && \ mkdir -p /tmp/mattermost/data # backup data cp -R /var/opt/gitlab/mattermost/* /tmp/mattermost/data && \ chmod 777 /tmp/mattermost # backup db cd /tmp/mattermost && \ /opt/gitlab/embedded/bin/pg_dump -U gitlab_mattermost -h /var/opt/gitlab/postgresql -p 5432 mattermost_production > mattermost_production_backup.sql # package and cleanup cd /tmp && \ tar -zcf mattermost.tar.gz mattermost && \ rm -rf mattermost && \ mv mattermost.tar.gz /backups } export -f backup_mattermost export -f backup_gitlab ####### ## MAIN function main { # initialize sudo rm -rf /backups && \ sudo mkdir /backups > /dev/null 2&>1 || true && \ chmod -R 777 /backups # main su root -c "bash -c backup_gitlab" su mattermost -c "bash -c backup_mattermost" # finalize...

READ MORE