Auto Snapshots
Eloi Marques da Silva
Auto Snapshots with Service Stop/Restart Feature
This feature allows Easypanel to automatically create snapshots of running services while giving the option to stop a service before taking the snapshot and restart it once the process is complete.
- Service-Level Interface and Configuration
- New "Auto Snapshots" Tab:
In each service, add an "Auto Snapshots" tab (similar to the existing database backups section) to allow individual configuration of automatic snapshots.
Configuration Options:
Within this tab, users can configure:
- Enable/Disable: A toggle to activate or deactivate automatic snapshot creation for the service.
- Schedule/Frequency: Predefined intervals (e.g., hourly, daily, weekly).
- A field for entering a cron expression for more customized scheduling.
Retention Policy:
- Define the maximum number of snapshots to keep.
- Specify an expiration time for each snapshot, with the automatic removal of older snapshots.
Storage Location Selection:
- A dropdown list showing configured storage providers (local, SFTP, FTP, Dropbox, Google Drive, etc.) with the option to select one or more destinations for redundancy.
Service State Management (Auto Stop/Restart):
- Auto Stop Toggle: An option that instructs Easypanel to automatically stop the service before initiating the snapshot.
- Controlled Procedure: A setting to determine if the service should automatically restart once the snapshot is completed. This may include designating a “maintenance window” or sending notifications to inform the user when the automatic stop will occur, thereby minimizing operational impacts.
These options enable users to tailor snapshot behavior according to the criticality of the service and its availability requirements.
- Automated Snapshot Process with Service Stop and Restart
- Snapshot Execution:
An internal Easypanel process monitors the configured schedules and triggers the snapshot routine at the set times.
- Service State Check and Adjustment:
- If the Service is Running:
With Auto Stop enabled, the system will detect if the service is active and automatically stop it before taking the snapshot.
- Controlled Execution:
Once stopped, the snapshot is generated. If stopping the service is not possible (due to maintenance restrictions or high-availability requirements), the system will log a warning and reschedule the task according to the defined conditions.
- Storage and Synchronization:
- Local Storage: The snapshot file is initially saved in a designated snapshots directory on the server.
- Remote Storage: Subsequently, a routine uploads the snapshot file to the selected remote storage providers using the configured credentials.
- Automatic Restart:
If Auto Stop/Restart is enabled, the service is automatically restarted once the snapshot creation is successfully completed, ensuring minimal downtime.
- Snapshot Visualization and Management
- History and Status:
The interface displays a list of all created snapshots, including details such as date, time, status (success, failure, pending), and the storage locations where they are saved.
- Available Actions:
- Download: Allows users to manually download the snapshot for external restoration or maintenance purposes.
- Restoration: Implements a "Restore" button to revert the service to the state captured in the snapshot.
- Deletion: Provides an option to manually delete snapshots that are no longer needed, alongside the automated cleanup via the retention policy.
- Notifications and Logs:
- Integrate notifications through email or via the Easypanel dashboard to inform users about snapshot execution, any service interruptions, or errors encountered.
- Maintain detailed logs of the snapshot operations for auditing and troubleshooting.
- Technical Considerations and Benefits
- Consistency and Integrity:
Similar to database backups, the snapshot must capture a complete and consistent state of the service. Enabling automatic service stoppage ensures data consistency by preventing concurrent modifications during the snapshot.
- Flexibility and Personalization:
Users can select the best strategy for their environment—either opting for snapshots without interruption or ensuring a consistent state with a brief service stop.
- Risk Reduction and Easier Recovery:
This approach creates a robust backup and recovery process, reducing the risk of data loss and simplifying service restoration after deployment failures or configuration errors.
This enhanced feature increases Easypanel's resilience by automating snapshots and intelligently managing service states. It not only enables fast recovery of critical services but also streamlines maintenance with minimal operational disruption.