コミットを比較
2 コミット
1716960559
...
d25f640c8b
作成者 | SHA1 | 日付 |
---|---|---|
守矢諏訪子 | d25f640c8b | |
守矢諏訪子 | ac5f5e1ab8 |
|
@ -39,6 +39,41 @@ class Kernel extends ConsoleKernel
|
|||
}
|
||||
}
|
||||
})->everyMinute();
|
||||
$schedule->call(function () {
|
||||
$dbbckp = '/work/storage/backup/mysql/';
|
||||
$flbckp = '/work/storage/backup/file/';
|
||||
$week = 604800; // 1週間
|
||||
$fname = date('Ymd').date('H'); // 日付+時
|
||||
|
||||
// DBのバックアップ
|
||||
exec('/usr/bin/mysqldump --no-tablespaces --user='.config('database.connections.mysql.username').' --host='.config('database.connections.mysql.host').' --password='.config('database.connections.mysql.password').' --databases '.config('database.connections.mysql.database').' > '.$dbbckp.$fname.'_mysql.sql');
|
||||
|
||||
// GZIPでDBを圧縮する(ストレージ為)
|
||||
exec('/bin/gzip '.$dbbckp.$fname.'_mysql.sql');
|
||||
|
||||
// ファイルのバックアップ
|
||||
exec('/bin/tar zcfv '.$flbckp.$fname.'.tar.gz /work/storage/app/private/*');
|
||||
|
||||
// 全てのSQLファイルを読み込むと、古いやつを削除する。
|
||||
foreach (scandir($dbbckp) as $s) {
|
||||
if ($s == '.' || $s == '..') continue;
|
||||
$t = str_replace('_mysql.sql.gz', '', $s); // extの削除
|
||||
$t = preg_replace('/[\w\d]{2}$/', '', $t); // 時間の削除
|
||||
if (strtotime($t) < time()-604800) {
|
||||
exec('/bin/rm -rf '.$dbbckp.$s);
|
||||
}
|
||||
}
|
||||
|
||||
// 全てのTARファイルを読み込むと、古いやつを削除する。
|
||||
foreach (scandir($flbckp) as $s) {
|
||||
if ($s == '.' || $s == '..') continue;
|
||||
$t = str_replace('.tar.gz', '', $s); // extの削除
|
||||
$t = preg_replace('/[\w\d]{2}$/', '', $t); // 時間の削除
|
||||
if (strtotime($t) < time()-604800) {
|
||||
exec('/bin/rm -rf '.$flbckp.$s);
|
||||
}
|
||||
}
|
||||
})->twiceDaily(0, 12);
|
||||
// $schedule->command('inspire')->hourly();
|
||||
}
|
||||
|
||||
|
|
|
@ -63,14 +63,25 @@ class FathersController extends Controller {
|
|||
];
|
||||
|
||||
try {
|
||||
// DBに入ります。
|
||||
EmailActivation::create($create);
|
||||
// DBの値の準備。
|
||||
DB::beginTransaction();
|
||||
|
||||
if (null !== ($oema = EmailActivation::where('email', $r->email)->first())) {
|
||||
$oema->delete();
|
||||
}
|
||||
$emac = new EmailActivation;
|
||||
$emac->fill($create);
|
||||
$emac->push();
|
||||
|
||||
// メールを送ります。
|
||||
Mail::to($r->email)->send(new FathersForgetPasswordMail($token));
|
||||
|
||||
// DBに入ります。
|
||||
DB::commit();
|
||||
} catch (\Throwable $e) {
|
||||
// 失敗
|
||||
Log::critical($e->getMessage());
|
||||
DB::rollback();
|
||||
return ['status_code' => 400, 'error_messages' => 'メールアドレスが未登録です。入力した情報を確認してください。'];
|
||||
}
|
||||
|
||||
|
|
長すぎる行があるためファイル差分は表示されません
|
@ -57,7 +57,7 @@ const ParentForgotPassword = () => {
|
|||
</span>
|
||||
</LoadingButton>
|
||||
{ _400error && <Alert type="fail" hide={()=>set400Error('')}>{_400error}</Alert> }
|
||||
{ _success && <Alert type="success" hide={()=>setSucess('')}> {_success}</Alert> }
|
||||
{ _success && <Alert type="success" hide={()=>setSuccess('')}>{_success}</Alert> }
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
【docker内】
|
||||
まずは下記のコマンドで新しいフォルダを創作して下さい。
|
||||
mkdir -p storage/backup/{file,mysql}
|
||||
|
||||
【docker外】
|
||||
「crontab -e」を実行すると、下記の行列を追加して下さい。
|
||||
0 0,12 * * * /usr/bin/docker cp 3463d3554a6f:/work/storage/backup/mysql/ /var/www/html/kikikanri/backup
|
新しいイシューから参照