I have a Linux server and in this I want to execute a cron job for sending birthday mail to all my friend with a PHP program. I want to create a php program that read data from database and send the mail.
I want to know the command of cron job to execute the program on every day automatically. I have no knowledge of Linux commands.
This is the command to add to your crontab file:
Adjust the paths to the PHP interpreter and your script as necessary. It will run your script every day at midnight.
You will want to read up a little bit on the 'crontab' command but basically you will do this.
From a linux command prompt run the crontab command.
Then add this entry:
You can set what time by modifying the * values. See this URL for information on that:
http://adminschoice.com/crontab-quick-reference
This is done using a cron table in unix systems, including linux. Check out some example documentation:
You'll find many more, if you google for
crontab
, or if you check out theman crontab
pages on your linux box