Skip to main content
Build reliable background tasks for common maintenance operations like database backups, file cleanup, analytics reporting, and media processing.

Overview

This example demonstrates how to automate essential maintenance tasks:
  • Database backups with S3 storage
  • File cleanup for temp files and logs
  • Analytics reporting with email notifications
  • Video thumbnail generation for media assets
  • Scheduled cron jobs for recurring maintenance
Perfect for keeping your production systems clean, backed up, and monitored.

Task Definitions

REST API Endpoints

Provide on-demand task triggering through REST endpoints:

Usage Examples

Trigger Tasks via API

Monitor Scheduled Tasks

Cron jobs run automatically but you can monitor them through Hyrex Studio:
  • Daily tasks run every morning at 9 AM
  • Weekly tasks run every Sunday at 2 AM
  • View execution history and performance metrics
  • Set up alerts for failed tasks

Cron Schedule Reference

Production Considerations

  • Backup retention: Implement S3 lifecycle policies to archive old backups
  • Error handling: Set up alerts for failed maintenance tasks
  • Resource usage: Schedule heavy tasks during low-traffic periods
  • Monitoring: Track backup sizes, cleanup counts, and processing times
  • Security: Use IAM roles for S3 access, secure database credentials

Next Steps

Error Handling

Handle failures and implement retry logic

Production Guide

Deploy maintenance tasks at scale