Back to Cron Helper
Recipephpbackendscripting
Run Raw PHP Script
Execute a PHP background worker script.You can run PHP scripts directly from the command line without a web server. This is useful for background workers, email processors, or cleanup tasks that shouldn't be exposed to the public web.
Cron Schedule
Every 30 Minutes
Runs at the top and bottom of every hour (minutes 0 and 30).*/30 * * * *Command to Run
Copy and paste this command into your crontab or automation script
/usr/bin/php /var/www/html/worker.phpImplementation Examples
Unix/Linux Crontab
*/30 * * * * /path/to/script.sh
Python (with schedule library)
schedule.every(30).minutes.do(job)
Node.js (with node-cron)
cron.schedule('*/30 * * * *', () => {
console.log('Running every 30 minutes');
});Go (with robfig/cron)
c.AddFunc("*/30 * * * *", func() { fmt.Println("Run every 30 mins") })GitHub Actions Workflow
- cron: "*/30 * * * *"
Related Cron Recipes
Automate PostgreSQL Backups Daily
databasepostgresbackup
Automate MySQL Backups Daily
databasemysqlbackup
Automate MongoDB Backups Daily
databasemongodbbackup
Automate Redis RDB Snapshots
databaserediscache
PostgreSQL Vacuum Analyze
databasepostgresmaintenance