Back to Cron Helper
Recipedatabaserediscachebackup
Automate Redis RDB Snapshots
Schedule a Redis background save (snapshot) via cron.While Redis can handle persistence automatically, triggering a specific `bgsave` via cron gives you control over exactly when snapshots occur. This is useful for syncing snapshots to external storage like S3 off-hours.
Cron Schedule
Every Hour
Runs at minute 0 of every hour (e.g., 1:00, 2:00, 3:00...).0 * * * *Command to Run
Copy and paste this command into your crontab or automation script
redis-cli bgsaveImplementation Examples
Unix/Linux Crontab
0 * * * * /path/to/script.sh
Python (with schedule library)
schedule.every().hour.do(job)
Node.js (with node-cron)
cron.schedule('0 * * * *', () => {
console.log('Running every hour');
});Go (with robfig/cron)
c.AddFunc("0 * * * *", func() { fmt.Println("Run every hour") })GitHub Actions Workflow
- cron: "0 * * * *"
Related Cron Recipes
Automate PostgreSQL Backups Daily
databasepostgresbackup
Automate MySQL Backups Daily
databasemysqlbackup
Automate MongoDB Backups Daily
databasemongodbbackup
PostgreSQL Vacuum Analyze
databasepostgresmaintenance
Rsync Incremental Backup
linuxbackupnetwork