[How to register database]
最終改訂(2023/11/02)
saga_uptest saga_LG_uptest
mysql> create database saga20190124_MW; Query OK, 1 row affected (0.00 sec) mysql> create database saga20190124_LG; Query OK, 1 row affected (0.00 sec)
> mysql saga20190124_MW -u suda -p < bak190124_saga20190123.sql > mysql saga20190124_LG -u suda -p < bak190124_saga_LG20190122.sql
> mysql saga -u suda -p < bak191208_saga20191119.sql > mysql saga_LG -u suda -p < bak191208_saga_LG20191207.sql
> sudo rsync -av ~/public_html/Data/html20210407/ Data/html/ > sudo rsync -av ~/public_html/Data/images20210407/ Data/images/
(1) create a new backup file on saga
[backup]% mysqldump --databases saga -u suda -p > bak091001_saga20090902.sql rule of filename: bak[date of creating backup]_[database name][date of the last update of database].sql
or
(1') find a backup file in saga
saga:/home/suda/public_html/backup/bak090510saga1.sql
(2') rename it (suda@saga) bak[date of creating the file]_[database name][date of the last update of the database].sql
[backup]% mv bak090510saga1.sql bak090620_saga20090505.sql
(3) open the file and change the database name from saga1 to saga20090505 (suda@saga)
[backup]% vi bak090620_saga20090505.sql
(4) issue commad (suda@saga)
[backup]% mysql -u suda -p < bak090620_saga20090505.sql
(1) ディレクトリ作成
[/var/www/html/Prev/]% sudo mkdir 20170901_MW [/var/www/html/Prev/]% sudo mkdir 20170829_LG
(2) データをコピーor移動: Retrieval[_LG], Lib, Data, TableStructure.txt
[/var/www/html/Prev/20170901_MW/]% sudo cp -rp ../../Lib ./ [/var/www/html/Prev/20170901_MW/]% sudo cp -rp ../../Retrieval ./ [/var/www/html/Prev/20170901_MW/]% sudo cp -rp ../../Data ./ [/var/www/html/Prev/20170901_MW/]% sudo cp -p ../../TableStructure.txt ./
(3) wikiを編集、リンクを確認。簡単な動作確認も忘れずに。
固定ページ/Log
(1) copy files (dbworker@saga)
% su dbworker [Prev]% mkdir /home/dbworker/public_html/Prev/20090505 [Prev]% cd ~/public_html/Prev/20090505 [20090505]% cp -p ../../TableStructure.txt ./ [20090505]% cp -rp ../../Lib ./ [20090505]% cp -rp ../../Retrieval ./ [20090505]% cp -rp ../../Data ./
[20090505]% mkdir Registration
[20090505]% cp -rp ../../Registration/html Registration/
[20090505]% cp -rp ../../Registration/images Registration/
[20090505]% cp -p ../../Registration/*css Registration/
(2) change $database_name in db.cgi from saga1 to saga20090505 (dbworker@saga)
[Retrieval]% vi db.cgi
(1) restore the backup file created at 1-(1).
[backup]% mysqldump -u suda -p saga20090902 < bak091001_saga20090902.sql
(2) edit db.cgi and backup file, and change the database name
[backup]% vi bak091001_saga20090902.sql [20090505/Retrieval] vi db.cgi
(3) upload backup file (rename database cannot be used after MySQL 5.14
[backup]% mysql saga20090905 -u suda -p < bak091001_saga20090902.sql
(1) check Entries in CSVfile (suda@saga)
[CSVfile]% mv A0134 storage/ [CSVfile]% mv A0095 storage/ [CSVfile]% mv A0120 storage/ [CSVfile]% mv A0173 storage/ [CSVfile]% mv A9999 storage/
(2) check registration database name and user name (suda@saga)
Main DB name : saga Temporary DB name : suda_tmp DB user name : saga_user [Lib]% vi settings.txt DBname:=saga DBuser:=saga_user
(3) confirm required files (suda@saga)
DBRoot/Tools/html_SIMBAD
(4) register (suda@saga)
[Registration]% ./registration.pl
(1) check the updated history at astro3:test.compilation_history.
select Date, User, Entry, Comment, TIMESTAMPDIFF( MONTH, Date, DATE(NOW()) ) as "Month Diff" from compilation_history where TIMESTAMPDIFF( MONTH, Date, DATE(NOW()) ) < 24 and Entry like "A%" order by Entry;
(2) update wiki
(1) Registration/settings_Reg.yaml
database_name : saga_LAMSUB run_copy_mysqldata : 0
| 変数名 | 値 | コメント |
| run_make_objectcatalog_MW | 1 | |
| run_list2sq | 1 | |
| run_solarabundance_correction | 1 | |
| #run_make_abn_tables | 0 | # obsolete |
| run_csv2ascii | 1 | # unnecessary for MW if uploaded for dSph. |
| run_plot_abundances | 1 | |
| run_print_starlist | 0 | # only for dwarf galaxy mode |
| run_define_standard_value | 1 | |
| run_define_star_class | 1 | |
| run_make_positiondata | 0 | # This is not yet implemented for dSph. # Output file is not used. |
| run_get_position | 1 | # need to run this twice for unknown reasons |
| run_copy_mysqldata | 1 | |
| add_comment_in_registration | 0 | registration tableはなし |
dir_in_csv : A : "../CSVfile_LAMSUB"
(2) ファイルやディレクトリの移動
(3) MySQLバックアップ(更新時のみ)
% cd DBHOME/vda4/bk_mysql/ % mysqldump --databases saga_LAMSUB -u suda -p > bak231102_saga_LAMSUB20200622.sql