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
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


Leave a Reply

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

You are commenting using your 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 )


Connecting to %s

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