I have an .exe setup to run every 5 minutes.It creates a file.
I have stored the users email in a mysql database. The file that get created is named after the primary key of the database.For example:
1.txt,2.txt,50.txt etc
Where 1,2,and 50 are the primary keys.
I was wondering if there was a way after the cron ran to email the users.I use php on my server.Is there some way to do this?
EDIT:
I think I can rather just set up a .php file to run on cron and use exec().
In your crontab, you can have cron entries and you can have environment variables. There is a variable called
MAILTOthat specifies the user that will receive the email containing any stdout or stderr from the processed jobs.To send email to vivek@nixcraft.in, enter:
If MAILTO is defined but empty (MAILTO=””), no mail will be sent.
The default (if
MAILTOis not set) is to email the local user who owns the crontab being executed.I haven’t tried it, but you may be able to set the email for just one of your cronjobs using something like this:
Anything after a
#on a line is of course a comment.Taken from http://www.cyberciti.biz/faq/linux-unix-crontab-change-mailto-settings/