Hi!

On Thu, 3 Jan 2002, Webmaster wrote:

>       I tried to search the archives for this but I can't find it.  (Not saying 
> it isn't there just I could not find it.)  I have a table that tracks 
> events on a monthly and daily basis.  Currently I am resetting the 
> appropriate fields to 0 on a daily and monthly basis (not fun).  Is there a 
> way to set a command in the cron table to do this for me 
> automatically?  Here are the details.
> 
> db name: activity
> daily field name: dr (needs to be reset to 0)
> monthly field name: mr (same as above)

test crontab entry:

* * * * * /usr/local/mysql/bin/mysql -e "use activity; update table_name
set dr=0"

Additionally the user of the cron should have a file ~/.my.cnf
to avoid giving the password in crontab:

<snip file="~/.my.cnf">
[client]
password=your_password
</snip>

>       I know how to tell cron the date/time I want an event to trigger, but I 
> don't know the syntax of the command to send.  Any help would be appreciated.

This one was easy :-)

> Thanks,
> David

HTH.

Regards, Zoltan


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to