Forum Moderators: coopster

Message Too Old, No Replies

Cron Jobs

         

mudogg80

3:30 pm on Aug 1, 2007 (gmt 0)

10+ Year Member



How do I go about creating a cron job to send an email to customers at a specified date? Lets say I have created an email that will be sent to customers every month notifying them of something....this script will access my database, grab the customers email addresses and send. I can manually send an email to many customers but I would like to use a cron job to do this. is this possible?

Thanks.

jatar_k

3:54 pm on Aug 1, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



absolutely

you create a script that does exactly what you describe and then schedule it via cron

about that easy

RonPK

5:10 pm on Aug 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It depends on your PHP installation as to how you can run scripts with cron. If you only have an Apache module, you'll need to call the script with a web client, basically like this:

* * * * * wget http://www.example.com/myscript.php

Otherwise, with a CLI or CGI installation, something like this might work:

* * * * * php /home/sites/www.example.com/scripts/myscript.php

henry0

5:56 pm on Aug 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I made a mini "How to..." [webmasterworld.com]

scroll up to message #2678

jatar_k

6:00 pm on Aug 1, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



that would be msg#3372065

the other number would be the post count ;)

henry0

12:05 pm on Aug 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just finished moving, so I still don't know what I do :)

dreamcatcher

7:06 am on Aug 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If your server uses CPanel, the following command should work:

php -q /home/serverpath/files/file.php

Using your own path of course.

dc