Forum Moderators: open

Message Too Old, No Replies

can I set a MySQL command to auto-repeat?

         

jcmoon

8:52 pm on Mar 29, 2006 (gmt 0)

10+ Year Member



Whilst I work I've a 2nd monitor with a terminal window open, ssh'ed into one of my servers, and each morning I type "top -d 10" and leave it at that, all day.

The result: a list of the processes running on the server, ranked according to CPU usage, updated every 10 seconds.

In another terminal window, can login to MySQL in this server. Once there, I can type "show processlist;" to get a list of whatever MySQL is doing at that moment ... but I don't know how to get this to repeat, automatically. Any advice?

bunltd

9:16 pm on Mar 29, 2006 (gmt 0)

10+ Year Member



I use mytop. You can also use it in conjunction with vpsinfo and get a lot of that information in a nicely displayed webpage.

LisaB

physics

4:44 am on Mar 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes mytop is good. Also you could write a little perl script that connects to the db, executes show processlist and prints it out. Then do:
watch -n 10 showprocesses.pl