[How to register database]
さくらサーバー用に改訂(2018/06/13)
(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