Sentinel is an automated backup system designed to secure your MariaDB databases and specified files to S3-compatible storage solutions.
- Automated MariaDB database backups using mysqldump
- File and directory backups using gitignore-style pattern matching
- Scheduled backups using cron syntax
- Compatible with S3, Cloudflare R2, MinIO, and other S3-compatible storage
- Configuration via environment variables for enhanced security
- Dockerized for easy deployment
- Optional configuration file path specified via command-line flag
- Go 1.16+ (for building from source)
- Docker (for containerized deployment)
- MariaDB
- S3-compatible storage account
-
Clone the repository:
git clone https://github.com/yourusername/sentinel.git
-
Build the Docker image:
docker build -t sentinel .
-
Create a
backup_include.txt
file with your backup patterns:/path/to/important/files/* !/path/to/important/files/temp /var/www/html/**/*.php
-
Run the container:
docker run -d --name sentinel \ -v /path/to/your/backup_include.txt:/root/backup_include.txt \ -e DB_HOST=your_db_host \ -e DB_PORT=your_db_port \ -e DB_USER=your_db_user \ -e DB_PASSWORD=your_db_password \ -e DB_NAME=your_db_name \ -e S3_ENDPOINT=your_s3_endpoint \ -e S3_REGION=your_s3_region \ -e S3_ACCESS_KEY_ID=your_s3_access_key \ -e S3_SECRET_ACCESS_KEY=your_s3_secret_key \ -e S3_BUCKET=your_s3_bucket \ sentinel
To use a custom path for the configuration file:
docker run -d --name sentinel \ -v /path/to/your/custom_config.txt:/root/custom_config.txt \ ... [other environment variables] ... sentinel --config /root/custom_config.txt
-
Clone the repository:
git clone https://github.com/yourusername/sentinel.git
-
Navigate to the project directory:
cd sentinel
-
Build the binary:
go build -o sentinel
-
Set up environment variables and run:
export DB_HOST=your_db_host export DB_PORT=your_db_port # ... set other environment variables ... ./sentinel
Or, to use a custom configuration file:
./sentinel --config /path/to/your/custom_config.txt
-
Create a configuration file (default:
backup_include.txt
) with your backup patterns:/path/to/important/files/* !/path/to/important/files/temp /var/www/html/**/*.php
-
Set the following environment variables:
DB_HOST
: MariaDB hostDB_PORT
: MariaDB portDB_USER
: MariaDB usernameDB_PASSWORD
: MariaDB passwordDB_NAME
: Database nameS3_ENDPOINT
: S3-compatible storage endpointS3_REGION
: S3 regionS3_ACCESS_KEY_ID
: S3 access keyS3_SECRET_ACCESS_KEY
: S3 secret keyS3_BUCKET
: S3 bucket name
To contribute to Sentinel:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GPL-3.0 License. See LICENSE
for more information.
- The Go community
- Contributors to the AWS SDK for Go
- Open-source backup solution developers