2014年6月18日水曜日

親ウィンドウを再読み込みするには

子ウィンドウから親ウィンドウを再読み込みする方法。


●動作
----------------------------------

子ウィンドウ
1.親ウィンドウを再読み込み
2.閉じる



●設定
----------------------------------

▼子ウィンドウ

<script type="text/javascript">
<!--
function w_close(){
window.opener.document.dammy.submit();
window.close();
}
//-->
</script>


※リロード、で行うと『このページを再表示するには・・・』で警告が出る。
window.opener.location.reload();

それを回避するため、submitを使う。
window.opener.document.dammy.submit();

<button type="button" onclick="w_close()">×閉じる</button>


▼親ウィンドウ

<!-- ▼子ウィンドウからのReload用 -->
<form name="dammy"></form>




ポイント!

ダミーのFormを用意してそれをsubmitする。

2014年1月20日月曜日

MySQL、Cronでリストア

MySQLデータのリストアをする。

サーバは、Ubuntu 12を使用。

Cronの設定、必要なコマンドをリストアップ



●Cron 月〜金 21:50 に実施
----------------------------------
sudo crontab -e 編集
sudo crontab -l 確認
ps aux | grep cron 動作確認

50 21 * * 1-5 /etc/cron.d/restore.sh リストア設定


●Web
----------------------------------
/var/www ファイル
/var/www/sql_data/backup.sql バックアップデータ


●シェル
----------------------------------
/etc/cron.d/restore.sh リストア


●権限
----------------------------------
sudo chown root restore.sh オーナー変更
sudo chgrp root restore.sh グループ変更


●アクセス権
----------------------------------
sudo chmod 777 restore.sh