Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old July 18th, 2003, 09:49 AM
Armitage Armitage is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 9 Armitage User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
CHECK TABLE cron job needed

Hey all,

This is my first post here, so go easy on me :-)
I am looking to run a nightly cron job that will run a CHECK TABLE on a given mysql database, then repair if necessary. Keep in mind that the database is not on the same server that would be running the cron.
I'd rather keep this a system level thing and not have to excecute a PHP file if possible.


Reply With Quote
  #2  
Old July 18th, 2003, 12:12 PM
jorgen jorgen is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hardenberg, Holland<marquee>
Posts: 284 jorgen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: CHECK TABLE cron job needed

You can use BASH + Cron...

Reply With Quote
  #3  
Old July 19th, 2003, 12:50 AM
Matt Matt is offline
Contributing User
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: CHECK TABLE cron job needed

you can call the mysql executable and have it run any sql script you choose.....


Reply With Quote
  #4  
Old July 19th, 2003, 12:12 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: CHECK TABLE cron job needed

i know you didn't want to include the php, but i think that if you are already good with php, the best way is to do it like this.

on a machine where you have a cron, set up a wget crong job to "start" your php script remotly.

do all your logic in that php file placed on that other server, and you are done...

Reply With Quote
  #5  
Old July 19th, 2003, 07:27 PM
Armitage Armitage is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 9 Armitage User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: CHECK TABLE cron job needed

Jorgen & Matt: I figured that, but I am not strong with BASH. Since there are new tables being added to my database all the time, how can I build up a list of the tables to check? I have created a small bash script that connects to the database and runs CHECK TABLE queries in a file called queries.sql, but I had to create that file manually to include all the table names.

Zombie: I was able to create this in PHP no problem, however, as I said I kind of wanted to stay away from PHP for this process. No real reason I suppose other than I would like to learn to do it with BASH.

Reply With Quote
  #6  
Old July 19th, 2003, 07:38 PM
honcho's Avatar
honcho honcho is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Cape Cod
Posts: 1,347 honcho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 2 sec
Reputation Power: 3
RE: CHECK TABLE cron job needed

To see all the tables in a database:
Code:
SHOW TABLES FROM `db_name`

Reply With Quote
  #7  
Old July 19th, 2003, 07:44 PM
Armitage Armitage is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 9 Armitage User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: CHECK TABLE cron job needed

honcho: thanks, but that will just display the list correct?
I really need to be able to capture that list into an array or something then iterate through it with a check and repair. I can do this fine in PHP, but as I said, I am not too strong in BASH.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > CHECK TABLE cron job needed


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT