A cron job question...

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
HormonX
Forum Commoner
Posts: 50
Joined: Tue Dec 10, 2002 7:43 pm
Location: Toronto

A cron job question...

Post by HormonX »

Can any one tell me if it is possible to run a MySQL query within a cron job command ?

If it is possible .. can you tell me how ?

Just to let you know am using a cron manager within CPanel 9

Greg
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Sure it is, you can run pretty much anything, just have the command as something like:

Code: Select all

mysql -u bob -password=blah mydatabase < "UPDATE table SET rah = '4' WHERE id = '1';"
Or you could have it read the SQL queries from a text file. Just have a play about and see what works.
kgourad
Forum Newbie
Posts: 4
Joined: Wed Jan 19, 2005 11:49 pm

yes you can

Post by kgourad »

Yes you can do that with a cron job. Here is a good webpage to help

Khalid Gourad
Post Reply