Question : cron job php
Answered by : you
<?php
// Define the command to be executed by the cron job
$command = 'php /path/to/your/php_script.php';
// Define the cron schedule (e.g., run every 5 minutes)
$schedule = '*/5 * * * *';
// Build the cron command
$cronJobCommand = sprintf( "echo '%s %s' | crontab -", $schedule, $command
);
// Execute the cron job command
exec($cronJobCommand);
?>
Source : | Last Update : Tue, 19 Sep 23