View Full Version : automation to run reports

07-07-2007, 05:24 AM
I have a fleet allocation report on my website, and what i'm wanting to do is this:

users can register to have a weekly report sent to them on the fleet allocation, by registering to a mailing list
once a week (possibly like midnight Sundays), the report will automatically generate, make it into a pdf form or something like that, then send to everybody on the mailing list.

So firstly, is this possible?
secondly, how could such be implemented into an existing script or would one have to be duplicated to do such functions?

thanks in advance!

07-07-2007, 05:29 AM
Here is a nice report from zend on how to make pdf's


07-07-2007, 06:02 PM
If you're on a Linux box, you're going to need a cron job to run a PHP script that makes the PDF file and then emails it out for you. A cron job is like a batch job and you can set it to run (execute) anytime you want so Sunday at 11:00pm is fine.

If you're on a Windows server you'll have to check and see what they use that is like a cron job on Linux. I only host my sites on Linux boxes so I don't know what they use on Window servers.

Next problem is, regardless of what kind of server you're on, is batch job permissions. On shared servers (you probably are on a shared server) some hosting providers do not allow cron (batch) jobs to run because they are difficult to debug and determine that they are running correctly since there is no GUI or other way to easily debug. There is a risk the script could run badly and in the worst case, tie up all or most of the CPU resources, etc.

Hint: I run my cron PHP scripts in a browser so I can spit debug info onto the screen and check it that way. Anyway, check with your hosting provider and see if you can run a cron job. If you cannot then you can still do this but you'll have to manually run the PHP script yourself once a week.

07-08-2007, 04:52 AM
Thanks for the replies. I noticed in my C-Panel last night a 'Cron Job' section and then once in it, had a choice between 'Standard' & 'Advanced (unix style)'

I tried looking up different things about it, but have absolutely no idea as to do it.

So it appears I probably can run 'Cron Jobs', but don't know what the syntax would be.

I'm presumming what ever the wording in Cron Job would be, would be to run this page at this time and send to mailing list?