View Single Post

  #2 (permalink)  
Old 11-18-2007, 09:26 AM
monk's Avatar
monk monk is offline
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

use mysql -e 'sql-command1;sql-command2;' syntax for shell script to dump infomation from a shell script.
for example
Code:
#!/bin/bash
file="/tmp/output.$$"
cat /proc/cpu >$file
mysql -u user -p password db-name -e "sql-command to dump data from $file"
/bin/rm -rf $file
Above is just an example now a working code but it should be used as starting point you can call about script from a crontab

On a related note I recommend php for all sort of work for getting input from system to dumping data to generating reports. PHP can work from a shell and cron
__________________
May the force with you!
Reply With Quote