Forums

Schedule Task for MYSQL Database

I want to run a MYSQL statement once a day on the scheduled tasks but I'm completely lost how to get it setup. Do I put the statement in a batch file and if I do that then what is the hash bang syntax to call it?

I could use a Django query in a python file to do the deletion but I want to learn how to venture outside the python files in the scheduler.

Thanks.

You could probably do it as a bash script that calls the mysql command line client. I've never tried this directly, but I'd guess that instead of starting an interactive MySQL session you could specify SQL on the command line and have it executed. Read up on the mysql command line tool and see if there's anything that you can use.