Crontab a PHP script updates MySQL and sends mail

sandyde2 2004-12-16 07:59:19
Hi all,

I have searched in this php forum but found nothing about
this topic. Perhaps it should be a job for Perl or Python
to do. I have no idea so far and need your suggestion.

I want to do two things once a day by using crontab in linux.

1. UPDATE table1 SET flag=1 WHERE flag=0 AND endtime_ts>time()
2. Send e-Mail to those users with flag=2 and update_ts is today

The crontab will be run on the server. The easiest way i can
figure out is to write the script in PHP. Then write a bash
script to trigger this PHP script. Finally crontab this bash
script for once a day.

Do you have any better way other than mine? It is ok that you
teach me a Perl solution. But please write in very detail so
that i can understand :)

with best wishes

sandy
...全文
96 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
hahawen 2004-12-16
  • 打赏
  • 举报
回复
"php.sh aa.php"
sandyde2 2004-12-16
  • 打赏
  • 举报
回复
hmmm.. exe file will not work in Linux..
starimpact 2004-12-16
  • 打赏
  • 举报
回复
Crontab is a program that allows users to create jobs that will run at a given time.
I think you can write a EXE file to get it
sandyde2 2004-12-16
  • 打赏
  • 举报
回复
there is a problem in my way. The bash script will call the php
script by http://www......... which will generate a window which
looks quite dirty. I want to run the php script or the script written
by any other languages in daemon.

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧