DJack
DJack

Reputation: 639

Periodically delete MySQL table data

I would like to delete all the data from a specific MySQL table every day at 00:00. What is the best way to achieve that?

I was thinking of creating a simple PHP script that runs a mysql query every day at 00:00, I would then run the script using an online cronjob service..is this a good way to do it?

Thx

Upvotes: 0

Views: 302

Answers (2)

HiroshiFuu
HiroshiFuu

Reputation: 311

Usually, to set up a cron job to run a script. You could use Perl for the scripts. And bash etc will do it as well.

Upvotes: 1

Kancho Iliev
Kancho Iliev

Reputation: 701

CRONTAB is simplest way. You should create simple shell script, it can be php file for interpreter too but in it you'll put only delete command. Crontab will carry on about 00:00 hour execution.

Upvotes: 0

Related Questions