FRIHOST • FORUMS • SEARCH • FAQ • TOS • BLOGS • COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Help In Setting Up A Cron Job





manum
I want to send out emails to every one on my mailing list everyday once automactically

I know this is done using cron jobs

does any body has any idea as to how to set them up???????

I am also trying to find the solution and if i get to it first i shall tell u all...
hexkid
If you're using FriHost and DirectAdmin, do this

1. Create a directory for the script that will be run from the cronjob. This directory should not be accessible from the internet (so that users do not "fire" the cronjob at odd times), so it's a good idea to create it outside public_html (or protect it with an .htaccess). Let's say you created "cronjobs" at /home/YOURFRIHNAME/domains/YOURDOMAIN/cronjobs/

2. Create testmail.php file in that directory to send the mails
Code:
<?php
mail('manum@example.com', 'test', 'test succeeded');
?>


3. In DirectAdmin home click your domain

4. Click Cronjobs in "Advanced Features"

5. Put 0 (zero) in minute, leave the star in the "Hour", "Day of Month", "Month" and "Day of Week", and specify the command as
Code:
/usr/local/bin/php -q /home/YOURFRIHNAME/domains/YOURDOMAIN/cronjobs/testmail.php


6. Change testmail.php to mail other people once you've got it working for you.
manum
Thanks buddy... I got it set up as a charm....
Related topics
Cron Job to Backup MySQL Database
cron job
How to run a cron job on a server
cgi guestbook... need help setting up.
Cron job
what can a cron job do for you?
Cron job and browser output question
Cron job
ΏCron Job en Frihost?
How to get a php script working under a cron job?
CRON Jobs
Run a php Script with a Cron Job
Possible cron job usage?
Cron Job usage on FriHost
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.