This Dockerized Python project creates backups from a specified directory and uploads them to a MinIO or S3 bucket. The script logs each step of the process, including a progress update, to help track how the backup is proceeding.
- Clone the repository to your local machine.
- Install Docker and Docker Compose, if they're not already.
- Build the Docker image with the following command:
docker-compose build
Replace the following values in your .env
file within the project root:
- MINIO_URL: URL of your MinIO server
- MINIO_ACCESS_KEY: Your MinIO server access key
- MINIO_SECRET_KEY: Your MinIO server secret key
- MINIO_BUCKET: The bucket in your MinIO server where the backups will be stored
The .env
file should look like this:
MINIO_URL=<your-minio-url>
MINIO_ACCESS_KEY=<your-access-key>
MINIO_SECRET_KEY=<your-secret-key>
MINIO_BUCKET=<your-bucket-name>
-
Make sure to map the backup directory(
/opt
in the example) correctly in the Docker Compose file. -
Run the Docker container via Docker Compose:
docker-compose up
For running this service periodically, you can leverage crontab.
-
Open the crontab editor with:
crontab -e
-
Add the following line to run the script at your prefered time (this example runs it every day at 3 a.m.):
0 3 * * * docker run --env-file=/path/to/your/.env -v /opt:/backup:ro ghcr.io/dkruyt/minio-backup/minio-backup:latest
Be sure to replace
/path/to/your/.env
with the path to your .env file. -
Save and close the file.
- Fork the project.
- Create a new branch for your feature (
git checkout -b feature/YourFeature
). - Commit your changes (
git commit -m 'Add some feature'
). - Push the branch (
git push origin feature/YourFeature
). - Create a new Pull Request.
This project is licensed under the terms of the General Public License v3.0 license.