From 1b6b245e37c176142d2a8385097163ac5e12fda9 Mon Sep 17 00:00:00 2001 From: james Date: Tue, 24 Mar 2009 16:58:02 +0000 Subject: [PATCH] Create (and protect) a logs data/logs folder and store annealer logs there incase they're needed down the road --- admin/judges_sa_launcher.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/admin/judges_sa_launcher.php b/admin/judges_sa_launcher.php index c28aa39..ddf70ff 100644 --- a/admin/judges_sa_launcher.php +++ b/admin/judges_sa_launcher.php @@ -1,6 +1,14 @@ /dev/null 2>&1 &"); -usleep(1000000); // 1 second to allow the judges_sa to update the % status to 0% otherwise the status page will think its not running if it gets there too soon + +//make sure logs folder exists, and htaccess it to deny access +if(!file_exists("../data/logs")) + @mkdir("../data/logs"); + + if(!file_exists("../data/logs/.htaccess")) + @file_put_contents("../data/logs/.htaccess","Order Deny,Allow\r\nDeny From All\r\n"); + +exec("nice php judges_sa.php >../data/logs/judge_scheduler_".date("YmdHis").".log 2>&1 &"); +usleep(1500000); // 1.5 second to allow the judges_sa to update the % status to 0% otherwise the status page will think its not running if it gets there too soon header("Location: judges_scheduler_status.php"); exit; ?>