cron question

Soldato
Joined
4 Jul 2004
Posts
2,647
Location
aberdeen
hello,
I have a script that I need to run every night.

But I need it in the email for results to email me the contents of a script.

I thought of making the cron job do wget, but that doesn't seem to email me the results of the page i am sending wget to get. One way i thought of was in the script just making it email me, but that will end up in me getting 2 emails (one from cron, one from the script).

How can i do this?
thanks
 
Where/what does the script output? If it's to stdout, then you could probably just pipe the command to mail and suppress the cron output. Something like:
Code:
00 23 * * * php script.php| mail [i]mail-options-here[/i] >> /dev/null 2>&1
 
Back
Top Bottom