build cback
cback currently supports building on RHEL and Alma 8/9. Please avoid trying to build cback on differing distros, as they are unsupported. To manually build cback for testing or evaluation, do the following:
- Clone the cback repository with
git clone https://gitlab.cern.ch/cback/restic-backup-agent
- Install required dependencies for building and running with:
dnf install gcc rpmdevtools restic python39 python39-pip
for Alma, ordnf install gcc rpmdevtools restic python39 python3.9-pip
for RHEL
- Install poetry with their official installer
- Build an rpm from source with
make rpm
from inside the cloned repo - Install with
dnf install cback-*noarch.rpm; poetry install
- Test that cback has built correctly with
cback --version
[note] if you are iteratively developing cback with new features using this method, you can build and install
quickly with make clean; make rpm; dnf remove cback -y; dnf install cback-*noarch.rpm -y
build a cback database
cback requires a MySQL database for agents to run, we provide for this purpose within the src/repository/mysql
directory:
init.sql
to instantiate a new DBbackup_procedures.sql
to update and or install backup specific sql proceduresprune_procedures.sql
ditto^ for prunerestore_procedures.sql
ditto^ for restoreverify_procedures.sql
ditto^ for verify
The means of installing and providing a database is left to the reader, however you can install each of these using:
DB_IP=<ip>
DB_PORT=<port>
USERNAME=<username>
mysql -h $DB_IP -P $DB_PORT -u $USERNAME -p < src/repository/mysql/init.sql
mysql -h $DB_IP -P $DB_PORT -u $USERNAME -p cbackboxdb < src/repository/mysql/backup_procedures.sql
mysql -h $DB_IP -P $DB_PORT -u $USERNAME -p cbackboxdb < src/repository/mysql/prune_procedures.sql
mysql -h $DB_IP -P $DB_PORT -u $USERNAME -p cbackboxdb < src/repository/mysql/restore_procedures.sql
mysql -h $DB_IP -P $DB_PORT -u $USERNAME -p cbackboxdb < src/repository/mysql/verify_procedures.sql