You are browsing a read-only backup copy of Wikitech. The live site can be found at

GitLab/Cheat Sheet

From Wikitech-static
Jump to navigation Jump to search

More or less loose collection of GitLab commands that might be helpful (or were helpful at some point)



Reboot GitLab instance:

cookbook sre.hosts.reboot-single

Restart GitLab service:

gitlab-ctl restart

Restart (git) SSH daemon:

systemctl restart ssh-gitlab

Check GitLab status:

gitlab-ctl status

Backup and Restore

Trigger a full backup:

systemctl start full-backup

Trigger a config backup:

systemctl start config-backup

Get logs of backup:

journalctl -u full-backup

Sync backup to replica (assuming gitlab1003 is the replica):

systemctl start
systemctl start

Trigger a restore on replica:

systemctl start backup-restore

Check status of restore:

systemctl status backup-restore.service

Check logs of restore:

journalctl -u backup-restore.service



Gracefully reboot all GitLab Runner:

cookbook sre.gitlab.reboot-runner --reason "reason" --alias gitlab-runner reboot

Restart gitlab-runner service:

systemctl restart gitlab-runner


Unregister Runner (note, this can also be done by setting profile::gitlab::runner::ensure to absent and run puppet):

gitlab-runner unregister --name `hostname -f`

Unregister Trusted Runner (different because running as non-root:

su -s /bin/bash gitlab-runner -c "gitlab-runner unregister --name `hostname -f`"

Register Runner (handled by puppet):


Clean docker cache:

Cleanup old docker volumes in /var/lib/docker: