Cron Recipes

Practical cron job implementations for databases, DevOps, and popular frameworks.

Automate PostgreSQL Backups Daily

Recipe
How to schedule a daily PostgreSQL database backup using cron.

Automate MySQL Backups Daily

Recipe
Schedule a daily MySQL database dump using cron.

Automate MongoDB Backups Daily

Recipe
How to schedule a daily MongoDB backup using cron.

Automate Redis RDB Snapshots

Recipe
Schedule a Redis background save (snapshot) via cron.

PostgreSQL Vacuum Analyze

Recipe
Automate PostgreSQL database maintenance with VACUUM ANALYZE.

Sync Folder to AWS S3

Recipe
Cron job to sync local files to an AWS S3 bucket.

Rsync Incremental Backup

Recipe
Schedule secure, incremental backups using rsync.

Website Uptime Monitoring

Recipe
Simple cron job to check if a website is reachable.

Auto-Renew Let's Encrypt SSL

Recipe
Cron job to automatically renew Let's Encrypt SSL certificates.

Clean Up Unused Docker Resources

Recipe
Weekly cron job to remove unused Docker containers and images.

Clear Linux Page Cache Weekly

Recipe
Cron job to clear Linux RAM cache every week for maintenance.

Delete Old Log Files

Recipe
Automated cron task to delete logs older than 30 days.

Auto-Update System Packages

Recipe
Weekly cron job to update Linux system packages.

Clean Temporary Folder

Recipe
Remove temporary files that haven't been accessed in 10 days.

Run Laravel Task Scheduler

Recipe
The standard cron entry required to run Laravel Task Scheduler.

Run Magento 2 Cron

Recipe
Required cron job for Magento 2 e-commerce stores.

Trigger System WP-Cron

Recipe
Optimize WordPress by triggering wp-cron via system cron.

Trigger Drupal Cron

Recipe
Execute Drupal maintenance tasks via Drush.

Run Django Management Command

Recipe
How to run a custom Django management command via cron.

Run Ruby on Rails Task

Recipe
Schedule a Ruby on Rails runner task via cron.

Trigger Next.js ISR Revalidation

Recipe
Cron job to trigger Incremental Static Regeneration in Next.js.

Run Node.js Script

Recipe
Execute a standalone Node.js script using cron.

Run Python ETL Script

Recipe
Schedule a Python data processing script with logging.

Run Raw PHP Script

Recipe
Execute a PHP background worker script.

Git Auto-Pull (Simple Deploy)

Recipe
Periodically pull changes from Git (Simple CI/CD).

Rotate PM2 Logs

Recipe
Flush PM2 logs daily to save disk space.

Daily NPM Security Audit

Recipe
Check project dependencies for security vulnerabilities.