Slow Controls Time History: Difference between revisions
No edit summary |
No edit summary |
||
(8 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
Produces Web-based timeline plots, can be viewed on http://clasweb.jlab.org/cgi-bin/epics_history/epics.pl. | |||
Resides in CVSROOT=/home/epics/cvs, normally checked out to /home/epics/history and running on clon01 as user ''epics''. | Resides in CVSROOT=/home/epics/cvs, normally checked out to /home/epics/history and running on clon01 as user ''epics''. | ||
Line 9: | Line 11: | ||
Cron job is checking if main script is running (if not it will try to restart it): | Cron job is checking if main script is running (if not it will try to restart it): | ||
0,15,30,45 * * * * /home/epics/history/www/check_get.pl | 0,15,30,45 * * * * (/bin/tcsh -c /home/epics/history/www/check_get.pl >> /dev/null) | ||
If started by cron job, log file ''/home/epics/history/log/get_latest_cont.log'' will be produced | |||
<font color=red> | |||
(CURRENTLY GOES TO /dev/null !!!) | |||
</font> | |||
Database ''epics'' on ''clondb1'' was creates as follwoing: | Database ''epics'' on ''clondb1'' was creates as follwoing: | ||
Line 29: | Line 34: | ||
cd /home | cd /home | ||
mysqldump -uroot -pe1tocome epics | gzip > / | mysqldump -uroot -pe1tocome epics | gzip > /home/epics.sql.gz | ||
mysqldump: Can't get CREATE TABLE for table `hallb_sf_xy560_0_12_1min` (Can't open file: 'hallb_sf_xy560_0_12_1min.MYI'. (errno: 145)) | mysqldump: Can't get CREATE TABLE for table `hallb_sf_xy560_0_12_1min` (Can't open file: 'hallb_sf_xy560_0_12_1min.MYI'. (errno: 145)) | ||
one table: | |||
mysqldump -uroot -pe1tocome epics hallb_sf_xy560_0_12_1hr > 1hr.sql | |||
(works) | |||
mysqldump -uroot -pe1tocome epics hallb_sf_xy560_0_12_1min > 1min.sql | |||
mysqldump: Can't get CREATE TABLE for table `hallb_sf_xy560_0_12_1min` (Can't open file: 'hallb_sf_xy560_0_12_1min.MYI'. (errno: 145)) | |||
Following command produce error message but runs (took about 33 minutes): | Following command produce error message but runs (took about 33 minutes): | ||
Line 48: | Line 59: | ||
(last command took about 19 minutes). | (last command took about 19 minutes). | ||
<font color=red> | |||
TODO: | TODO: | ||
understand | understand errors reported by 'mysqldump'; fix database if necessary | ||
when script 'get_latest_cont.pl' was started it produced the number of errors into log file | when script 'get_latest_cont.pl' was started it produced the number of errors into log file | ||
'/home/epics/history/log/get_latest_cont. | '/home/epics/history/log/get_latest_cont.log1'; currently script is writing to /dev/null | ||
so log file can be used to see what was wrong | so log file can be used to see what was wrong | ||
</font> | |||
'''NOTE''': password to slow control timeline to add or delete: ''arne''. |
Latest revision as of 17:07, 19 March 2010
Produces Web-based timeline plots, can be viewed on http://clasweb.jlab.org/cgi-bin/epics_history/epics.pl.
Resides in CVSROOT=/home/epics/cvs, normally checked out to /home/epics/history and running on clon01 as user epics.
Main script is:
get_latest_cont.pl
It reads EPICS channels and updates epics database on clondb1.
Cron job is checking if main script is running (if not it will try to restart it):
0,15,30,45 * * * * (/bin/tcsh -c /home/epics/history/www/check_get.pl >> /dev/null)
If started by cron job, log file /home/epics/history/log/get_latest_cont.log will be produced (CURRENTLY GOES TO /dev/null !!!)
Database epics on clondb1 was creates as follwoing:
mysql> create database epics; mysql> grant ALL on epics.* to marki@clon01.jlab.org identified by '********'; mysql> grant ALL on epics2.* to marki@clon01.jlab.org identified by '********'; mysql> grant SELECT,INSERT,UPDATE on epics.* to epics@clon01.jlab.org; mysql> grant SELECT,INSERT,UPDATE on epics2.* to epics@clon01.jlab.org; mysql> grant SELECT on epics.* to clasweb@claspc28.jlab.org; mysql> grant SELECT on epics2.* to clasweb@claspc28.jlab.org;
Web software runs on clasweb machine. It can be found in /u/group/clas/www/clasweb/htbin/epics_history' directory, in particular file 'db_parms.pm' contains the name of database machine (in our case clondb1) and other related attributes.
IMPORTANT: DUMPING FROM clasweb-bck:
cd /home mysqldump -uroot -pe1tocome epics | gzip > /home/epics.sql.gz mysqldump: Can't get CREATE TABLE for table `hallb_sf_xy560_0_12_1min` (Can't open file: 'hallb_sf_xy560_0_12_1min.MYI'. (errno: 145)) one table: mysqldump -uroot -pe1tocome epics hallb_sf_xy560_0_12_1hr > 1hr.sql (works) mysqldump -uroot -pe1tocome epics hallb_sf_xy560_0_12_1min > 1min.sql mysqldump: Can't get CREATE TABLE for table `hallb_sf_xy560_0_12_1min` (Can't open file: 'hallb_sf_xy560_0_12_1min.MYI'. (errno: 145))
Following command produce error message but runs (took about 33 minutes):
mysqldump -f -l --opt -uroot -pe1tocome epics | gzip > /home/epics.sql.gz mysqldump: Got error: 1016: Can't open file: 'hallb_sf_xy560_0_12_1min.MYI'. (errno: 145) when using LOCK TABLES mysqldump: Can't get CREATE TABLE for table `hallb_sf_xy560_0_12_1min` (Can't open file: 'hallb_sf_xy560_0_12_1min.MYI'. (errno: 145)) mysqldump: Can't get CREATE TABLE for table `hallc_MeV_1min` (Can't open file: 'hallc_MeV_1min.MYI'. (errno: 145)) mysqldump: Can't get CREATE TABLE for table `ioctorus1colonloadPercent_1min` (Can't open file: 'ioctorus1colonloadPercent_1min.MYI'. (errno: 145))
Import into clondb1: type following on clondb1:
cd /database scp clasweb-bck:/home/epics.sql.gz . gunzip epics.sql.gz mysql -u root -p epics < epics.sql
(last command took about 19 minutes).
TODO:
understand errors reported by 'mysqldump'; fix database if necessary
when script 'get_latest_cont.pl' was started it produced the number of errors into log file '/home/epics/history/log/get_latest_cont.log1'; currently script is writing to /dev/null so log file can be used to see what was wrong
NOTE: password to slow control timeline to add or delete: arne.