Would have been to MySQL database to create an event task to execute the stored procedure, DO data transfer ... Later, for various reasons, the crontab is used to execute periodically, calling the stored procedure.
Implementing this data transfer is divided into two steps:
The first step: Write a shell script to call the MySQL database stored procedure as follows:
#!/bin/bash
#0 1 * * * sh/home/drmtrans3/rj_proc.sh
host1=127.0.0.1
User=system
Passwd=linux
port=3306
Mysql-h${host1}-u${user}-p${passwd}-p${port}-e "Call Library name data. Process Name Pro";
This makes it possible to invoke the process of executing the library data Pro.
Step Two: Create the crontab timer task, set the script to execute at 1 o'clock in the morning/home/drmtrans3/rj_proc.sh
#vi/var/spool/cron/root
Add statement
0 1 * * * sh/home/drmtrans3/rj_proc.sh
These two steps enable you to invoke the MySQL database stored procedure using a shell script and set a scheduled task.
This article is from the "Guangzhou Linux operation and Maintenance" blog, please be sure to keep this source http://milenovo.blog.51cto.com/10554394/1692847
Invoke a MySQL database stored procedure using a shell script and set a scheduled task