straiforos / hortusfox-web

Self-hosted collaborative plant management system for your local environment
https://hortusfox.github.io
MIT License
0 stars 0 forks source link

Implement Cron Backups with Storage Solution Flexibility #1

Closed straiforos closed 2 months ago

straiforos commented 3 months ago

Description of your request After setting up private git repos for static information storage, it would be helpful to streamline img/* and MySQL incremental backups, as well as a full dump at a longer interval. If these processes could be scripted, they could be run by a cron job on my Docker server. This would be wicked cool to support Git or possibly any other storage mechanism via vendor backup scripts.

Describe the solution you'd like I would like to see the implementation of scripts that automate the backup process for both image files and MySQL databases. The scripts should handle incremental backups for both image files and the MySQL database. Additionally, a full database dump should be scheduled at a longer interval (e.g., weekly or monthly). These scripts should be designed to run as cron jobs on a Docker server.

The solution should also include a strategy to swap out storage solutions easily. For example, while I use GitLab with Git for my backups, others might want to use rsync or another method. The scripts should be modular, allowing users to specify their preferred storage mechanism through configuration settings or environment variables.

Describe alternatives you've considered An alternative solution would be to manually create and run backup scripts, but this approach lacks the automation and convenience of using cron jobs. Another alternative is to use third-party backup services, but this might not be as flexible or integrated as custom scripts tailored for this application. Additionally, these third-party services may not offer the same level of customization for different storage solutions.

Additional context Incorporating these backup scripts would not only streamline the backup process but also enhance data security and recovery options. Having automated backups would ensure that the data is consistently saved without manual intervention.

To support different storage solutions, the backup scripts could include configuration files or environment variables to specify the chosen method, such as Git, rsync, or others. This approach allows for flexibility and customization based on individual user needs.

Here are some potential resources and examples of backup scripts that could be used as a reference:

Screenshots of the current backup setup can be provided if needed for further context.

straiforos commented 2 months ago

Added backup scripts: https://gitlab.com/traiforce-home-cloud/cron-backups/-/blob/main/hortusfox-image-rsync.sh?ref_type=heads https://gitlab.com/traiforce-home-cloud/cron-backups/-/blob/main/hortusfox-mariadb-backup.sh?ref_type=heads