Scheduling Actions - Automation 101 question. [message #4004] |
Thu, 11 July 2002 18:57 |
jkrische2
Messages: 32 Registered: February 2002 Location: Topeka, KS
Karma: 0
|
Member |
|
|
Hello all!
I have a minor problem to solve. I have a MySQL DB hosted out on a remote server. This DB accumulates a lot of junk records in the course of its processing, and I would like to prune them.
So, I would like to find a way to create some sort of batch file/cron job/whatever scheduled script that instructs MySQL to find records of certain criteria & deletes them, let's say daily, in a completely unattended fashion.
I have a WinXP Pro and a MacOSX 10.1.5 box available to accomplish the task (will use whichever is easier & more appropriate for the job), and need to do it as cheaply as possible - some expense is OK, but not too much. Does anyone have any suggestions, or could at least point me to a resource somewhere that is on-point?
Thanks!
John Krische
|
|
|
Re: Scheduling Actions - Automation 101 question. [message #4008 is a reply to message #4004] |
Thu, 11 July 2002 19:59 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Just write a PHP script that would connect to the MySQL server and remove the junk records. On MacOS X use a cron deamon the schedule the running of the script once a day, at midnight for example.
For example:
0 0 * * * /my/dir/remove_sql_junk.php
FUDforum Core Developer
|
|
|
|