Commit Graph

6 Commits

Author SHA1 Message Date
3c256f1575 feat: update backup script with cleanup logic
- Adjust the script to include logic for cleaning up old backups
- Added support for handling PostgreSQL data directories
- Ensure temporary directories are cleaned after use

This update improves the backup process by ensuring that old backups
are properly cleaned up to save storage space and enhance efficiency.
It also includes logic to handle specific cases for PostgreSQL
directories, providing a more robust backup operation.
2025-04-23 11:15:04 +08:00
1e60ca2eb6 feat: add source size calculation to backup script
- Introduce SOURCE_SIZE variable in cm-script.yaml
- Remove redundant SOURCE_SIZE calculation

This change calculates the size of the data directory
prior to initiating the backup process. It ensures that
the backup script has accurate information about the size
of the source data, enhancing the logging and monitoring
of backup activities.
2025-04-22 22:19:16 +08:00
53347b6ca6 feat: enhance backup process for PostgreSQL data
- Added special handling for PostgreSQL data directories to ensure
  proper backup of the `pg_wal` folder.
- Backup now distinguishes between standard and PostgreSQL specific
  logic, improving the reliability of database backups.
- Implemented warnings suppression for unchanged files to prevent
  clutter during backups.

This update improves the robustness of the backup process, ensuring
that PostgreSQL data is handled correctly while also maintaining
standard directory backup functionality, providing better clarity
and usability to users performing backups.
2025-04-22 22:03:36 +08:00
e5e9bfd9f3 fix: update backup script for better directory handling
- Change TEMP_DIR to use a more structured temporary path
- Adjust rsync command to reflect the new directory structure
- Improve MSG_TEXT formatting for better clarity
- Add 'jq' to the dependencies for JSON processing

These changes address issues with the previous temporary directory location and enhance the output messages for a more informative backup success notification.
2025-04-22 15:48:17 +08:00
1203a57641 feat: add Feishu webhook notification for backups
- Include a webhook URL to send notifications after backups.
- Capture and log the duration and size of the backups.
- Create a new Kubernetes secret for storing the Feishu webhook URL.
- Enhance the backup script to notify users of backup success with details.

This change improves monitoring and user notification of backup events,
allowing for better awareness and response times in case of failure or
success of the backup processes.
2025-04-22 15:11:04 +08:00
6d2acdcd1e feat: add backup system with cron and daemon
- Create a new namespace for the backup system
- Implement a cron job for scheduled backups
- Add a daemon set to handle backup tasks across nodes
- Introduce necessary service accounts, roles, and role bindings
- Include environment variable handling and configuration via secrets and config maps
- Ensure triggering and execution workflow for backups is efficient

This commit establishes a new backup system that utilizes both a cron job and a daemon set to automate backups. It organizes the configurations and credentials needed for S3-compatible storage, allowing for seamless backup management across the specified nodes in the Kubernetes cluster.
2025-04-22 14:49:02 +08:00