Register
It is currently Sun Dec 21, 2014 7:39 pm

mysql table size


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Mon May 15, 2006 9:58 am   
User avatar
Hi,

I'd like to put together a shell script that will return the number of rows in one of my mysql tables. I know how to write the query and how to return the row count in sql, but I'm not familiar with how to do it in a bash script. The table is a queue so I'm going to setup a cron to run every hour or so and tell me how many rows are in the queue.

Any help would be tremendous!

Thanks!


Top
  
 PostPosted: Mon May 15, 2006 3:47 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
mysql -e "<query string>" > return_file
you can read the return_file and see how to parse it further... it may have one or two lines you don't want... or you can grep the return_file for the line that says "n number of rows"


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP