Sigit Yoga's Personal blog

berikut dokumentasi create table harian database mysql

buat bash script  createTable_dr_message_dailyMySQL
#!/bin/bash
day=$(date –date ‘tomorrow’ +”%Y%m%d”)
mysql -u(user) -p(password) –database=cms_broad –execute=”CREATE TABLE dr_message_$day (id int(11) NOT NULL AUTO_INCREMENT, transaction_id varchar(500) DEFAULT NULL, status varchar(500)
DEFAULT NULL, information varchar(500) DEFAULT NULL, transaction_date datetime DEFAULT NULL,PRIMARY KEY (id)) ENGINE=InnoDB;”

create crontab

25 01 * * *     /xxx/xxx/createTable_mt_messages_dailyMySQL

View original post