Schedule/Run Gitlab Backups
Project description
Gitlab Backup Manager (GLBM)
Gitlab Backup Manager is a tool to help manage Backups of Gitlab in one place.
Main Backup = gitlab-rake gitlab:backup:create
Backup Config = gitlab-ctl backup-etc
Getting started
Configuration Options
Configuration settings are used in the following order:
- Config YAML file ( see order below )
- OS Environment Variables
The order of config file checking location
- local directory where executable is running (Mostly used for dev.) - config.yaml
- $HOME/.config/glbm/config.yaml
- /etc/glbm_config.yaml
OS Environment Variables
GLBM_S3_BUCKET # Bucket name (required)
GLBM_S3_ENDPOINT_URL # URL to S3 (required)
GLBM_S3_DIRECTORY # Directory path in bucket (required)
GLBM_DAYS_TO_KEEP # Keep X days worth of backups (default: 30)
GLBM_NOTIFICATIONS_ENABLED #Send to Slack (default: "false")
GLBM_SLACK_TOKEN
GLBM_SLACK_CHANNEL_ID
GLBM_LOGGING_LEVEL # INFO, DEBUG, WARNING, ERROR & CRITICAL (defualt: INFO)
GLBM_SKIP_BACKUP_OPTIONS # db, repositories, uploads, artifacts, lfs, registry, and pages (optional)
Config file example
*Config file used same settings as OS Env above, but lowercase, and remove GLBM_
s3_bucket: bucket1
s3_endpoint_url: https://<domain>/<path>:<port>
s3_directory: gl_backups
days_to_keep: 14
notifications_enabled: "true"
slack_token: xoxb-xxxxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxxx
slack_channel_id: "ABCDEFGHIJC"
logging_level: "DEBUG"
skip_backup_options: ['registry', 'artifacts']
Installation (Preferred)
$ pip installl gitlab_bm
After install run the following to see default opitions:
$ glbm
Usage: glbm [OPTIONS] COMMAND [ARGS]...
Gitlab Backup Manager (GLBM) Ver. (x.x.x)
Options:
--version Show application Version
--help Show this message and exit.
Commands:
backup Run main backup
backup-etc Run Backup Config and upload to S3
complete Run backup, backup_etc, upload_to_s3 and delete_files
delete-files Delete old files on S3 based on (X) days to keep
show-active-config Show Active Config
Current Limitations
- Only supports Slack Notifications
- Manual setup of Main Backup in
gitlab.rb
still needed - (Scheduling of jobs) - Need to manually setup.
Development
Want to contribute? Great! No specifics at this point. Just basic GitHub Fork and Pull request.
For further info, see github guide on contributing to opensource project.
After cloning your Forked branch locally, and installing Poetry, you can run the following to setup dev env and test:
$ poetry install
Then to run, do the following:
$ poetry run glbm
License
MIT LICENSE.txt
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gitlab_bm-0.1.3.tar.gz
.
File metadata
- Download URL: gitlab_bm-0.1.3.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Linux/6.6.2-gentoo-dist
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3aeb1f8361de0f97ae83f3943cb2478378539bd1e4835acb18c3ada1393a0662 |
|
MD5 | e4151812d2890bb30e3c2b5dd71f4d72 |
|
BLAKE2b-256 | 7fcab03d518d765a815e81655116a5754d34e8484e802ec73bcc652a8867724a |
File details
Details for the file gitlab_bm-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: gitlab_bm-0.1.3-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Linux/6.6.2-gentoo-dist
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6140c2cfbe5619875175d83a806f5941ff7b96f15ad577cb3436768d28f5457f |
|
MD5 | 5054b52be81e4471b5cbba696f1185f5 |
|
BLAKE2b-256 | c7a1c6225e763d0c1d0a10215e9bfa025b499f6211accaa716d8f2f8ac3d16c6 |