crontab - Cron tab on linux -


i have .exe setup run every 5 minutes.it creates file.

i have stored users email in mysql database. file created named after primary key of database.for example:

1.txt,2.txt,50.txt etc 

where 1,2,and 50 primary keys.

i wondering if there way after cron ran email users.i use php on server.is there way this?

edit: think can rather set .php file run on cron , use exec().

in crontab, can have cron entries , can have environment variables. there variable called mailto specifies user receive email containing stdout or stderr processed jobs. send email vivek@nixcraft.in, enter:

mailto=vivek@nixcraft.in 

if mailto defined empty (mailto=""), no mail sent.

mailto="" 

the default (if mailto not set) email local user owns crontab being executed.

i haven't tried it, may able set email 1 of cronjobs using this:

0 0 * * * /root/daily_task.sh #will email crontab owner mailto=joe@gmail.com 0 1 * * * /root/other_daily_task.sh # email joe@gmail mailto=root 0 * * * * /root/hourly_task.sh #(hopefully) mails root , not joe 

anything after # on line of course comment.

taken http://www.cyberciti.biz/faq/linux-unix-crontab-change-mailto-settings/


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -