Source variables before starting reco on remote machine.
[u/mrichter/AliRoot.git] / MONITOR / alistoragemanager / setupStorageDatabase.sh
CommitLineData
7f97b015 1#!/bin/bash
2HOST="localhost" # IP of machine on which mysql database is located
7154c26c 3PORT="123"
4DATABASE="database"
5USER="user"
6PASS="pass123"
7TABLE="table"
8STORAGE_PATH="/some/path/"
efaef546 9MAX_SIZE="300000000"
10MAX_OCCUPATION="100"
11REMOVE_PERCENT="50"
12EVENTS_IN_FILE="20"
7154c26c 13EVENT_SERVER="localhost" # IP of machine running alieventserver
14EVENT_SERVER_USER="user"
15EVENT_SERVER_PORT="124"
efaef546 16STORAGE_SERVER="localhost" # IP of machine running alistorage
7154c26c 17STORAGE_SERVER_USER="user"
18STORAGE_SERVER_PORT="125" # server thread communication port
19STORAGE_CLIENT_PORT="126" # client thread communication port
20XML_SERVER_PORT="127" # server of xml files
21mysql -u root -ppassword -e "create database if not exists $DATABASE;"
22mysql -u root -ppassword -e "grant ALL PRIVILEGES on $DATABASE.* to '$USER'@'$HOST' identified by '$PASS';"
23mysql -u root -ppassword -e "use $DATABASE;"
24mysql -u root -ppassword -e "CREATE TABLE IF NOT EXISTS $DATABASE.$TABLE(\
7f97b015 25run_number int(6) NOT NULL,\
26event_number int(6) NOT NULL,\
27system text(7) DEFAULT NULL,\
28multiplicity int(5) DEFAULT NULL,\
29permanent tinyint(1) DEFAULT NULL,\
30file_path text(100) DEFAULT NULL,\
31PRIMARY KEY(run_number,event_number));"
32
33echo "-----------------------------"
34echo "Databases successfuly created"
efaef546 35echo "-----------------------------"