Hi everyone here,
i am working on a job portal, here i want a functionality,
My php code should send jobs as an email to the registered users AUTOMATICALLY at every weekend.
How can i do that ?
thanks n regards
WAQAS
Auto Execution of PHP Code
Moderator: General Moderators
-
waqas_punjabian
- Forum Commoner
- Posts: 67
- Joined: Wed Aug 10, 2005 9:53 am
Scheduling jobs
hi , Scheduling can be done using cron job ...
create a file like task_schedular.php
list all the processes to be executed in this file
add this file to the cron job
create a file like task_schedular.php
list all the processes to be executed in this file
add this file to the cron job
- dibyendrah
- Forum Contributor
- Posts: 491
- Joined: Wed Oct 19, 2005 5:14 am
- Location: Nepal
- Contact:
First create the email sending script and put somewhere ex : /var/www/html/send_email.php
* * * * * command_to_be_executed
| | | | |
| | | | |_ day of the week (0-6)
| | | |__ month(1-12)
| | |____ day of the month(1-31)
| |______ hour(0-23)
|________ minute(0-59)
To add the cron job just go to terminal and use following command :
After that add the following line if you wish to send email at 11pm every night :
Hope this might help in some extent.
Cheers,
Dibyendra
* * * * * command_to_be_executed
| | | | |
| | | | |_ day of the week (0-6)
| | | |__ month(1-12)
| | |____ day of the month(1-31)
| |______ hour(0-23)
|________ minute(0-59)
To add the cron job just go to terminal and use following command :
Code: Select all
#crontab -eCode: Select all
0 23 * * * /usr/bin/php -q /var/www/html/send_email.phpCheers,
Dibyendra