]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MONITOR/alistoragemanager/setupStorageDatabase_TEMPLATE.sh
saveViews extended to print trigger classes, displaying of logo fixed. Cleanup of...
[u/mrichter/AliRoot.git] / MONITOR / alistoragemanager / setupStorageDatabase_TEMPLATE.sh
1 #!/bin/bash
2
3 #-----------------------------------------------------------------------------------#
4 #                                                                                   #
5 #   This is a template for script creating database for Storage Manager             #
6 #   and setting all necessary variables for Storage Manager, Event Display          #
7 #   and Online Reconstruction.                                                      #
8 #                                                                                   #
9 #   Rename the file and copy it to your home directory:                             #
10 #                                                                                   #
11 #   cp setupStorageDatabase_TEMPLATE.sh ~/setupStorageDatabase.sh                   #
12 #                                                                                   #
13 #   Then put all correct hostnames, ports, databases details and passwords.         #
14 #   REMEMBER: do not commit this file after putting any datails in it !!!           #
15 #                                                                                   #
16 #                                                                                   #
17 #   First time after installation you also need to run this script in order         #
18 #   to initialize the database (remember to grant necessary privilages to it).      #
19 #                                                                                   #
20 #-----------------------------------------------------------------------------------#
21
22
23 HOST="localhost"   # IP of machine on which mysql database is located
24 PORT="123"
25 DATABASE="database"
26 USER="user"
27 PASS="pass123"
28 TABLE="table"
29 STORAGE_PATH="/some/path/"
30 MAX_SIZE="300000000"
31 MAX_OCCUPATION="100"
32 REMOVE_PERCENT="50"
33 EVENTS_IN_FILE="20"
34 EVENT_SERVER="localhost"   # IP of machine running alieventserver
35 EVENT_SERVER_USER="user"
36 EVENT_SERVER_PORT="124"
37 STORAGE_SERVER="localhost"      # IP of machine running alistorage
38 STORAGE_SERVER_USER="user"
39 STORAGE_SERVER_PORT="125"      # server thread communication port
40 STORAGE_CLIENT_PORT="126"      # client thread communication port
41 XML_SERVER_PORT="127"          # server of xml files
42 mysql -u root -ppassword -e "create database if not exists $DATABASE;"
43 mysql -u root -ppassword -e "grant ALL PRIVILEGES on $DATABASE.* to '$USER'@'$HOST' identified by '$PASS';"
44 mysql -u root -ppassword -e "use $DATABASE;"
45 mysql -u root -ppassword -e "CREATE TABLE IF NOT EXISTS $DATABASE.$TABLE(\
46 run_number int(6) NOT NULL,\
47 event_number int(6) NOT NULL,\
48 system text(7) DEFAULT NULL,\
49 multiplicity int(5) DEFAULT NULL,\
50 permanent tinyint(1) DEFAULT NULL,\
51 file_path text(100) DEFAULT NULL,\
52 PRIMARY KEY(run_number,event_number));"
53
54 echo "-----------------------------"
55 echo "Databases successfuly created"
56 echo "-----------------------------"