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