|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
Hi All,
I have a database that has to automatically on a daily basis check for certain things - add things to tables - and mail certain people according to results of the action. If one creates a PHP3 page to do these actions it works - but can those procedures be done by running a CRON job daily - would one run the .php3 page - or use some kind of MySQL command ? Hope you can help. |
|
#2
|
|||
|
|||
|
Yep, you can use cronjobs to run shell or Perl scripts for daily/weekly/monthly maintenance. Sometimes I use a batch file/sql file pair to clean up stuff...
Example ############## # file1.batch ############## use db_name; # clean out stuff older than two weeks and # run once a day delete from table_name where to_days(now()) - to_days(date_field) > 14; ############## # file1.sql ############## mysql -t -u username -ppassword < file1.batch # no spaces between -p and password # downside of this is that password is hard- # coded into the file but its quick and dirty Then run ./file1.sql from the command line or set up a cronjob to execute file1.sql whenever you want. Also works great with perl scripts, especially for MAIL functions, provided you have DBI set up and all that Kyuzo Nou ga aru taka wa tsume o kakusu |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > CRON + Mysql / PHP3 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|