simple bash script buat table harian dengan mysql

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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.