Skip to content

Commit 84f0ff7

Browse files
author
Till Brehm
committed
Merge branch 'goaccess-move-files' into 'develop'
GoAccess & AWstats move files instead of copying them #5723 See merge request ispconfig/ispconfig3!1141
2 parents 53fddf2 + 2210bde commit 84f0ff7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

server/lib/classes/cron.d/150-awstats.inc.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,13 @@ public function onRunJob() {
148148
mkdir($statsdirold);
149149
}
150150
$files = scandir($statsdir);
151+
152+
if (($key = array_search('index.php', $files)) !== false) {
153+
unset($files[$key]);
154+
}
155+
151156
foreach ($files as $file) {
152-
if (substr($file, 0, 1) != "." && !is_dir("$statsdir"."/"."$file") && substr($file, 0, 1) != "w" && substr($file, 0, 1) != "i") copy("$statsdir"."/"."$file", "$statsdirold"."$file");
157+
if (substr($file, 0, 1) != "." && !is_dir("$statsdir"."/"."$file") && substr($file, 0, 1) != "w" && substr($file, 0, 1) != "i") $app->system->move("$statsdir"."/"."$file", "$statsdirold"."$file");
153158
}
154159
}
155160

server/lib/classes/cron.d/150-goaccess.inc.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,12 @@ public function onRunJob() {
170170
}
171171

172172
$files = scandir($statsdir);
173+
if (($key = array_search('index.php', $files)) !== false) {
174+
unset($files[$key]);
175+
}
173176

174177
foreach ($files as $file) {
175-
if (substr($file, 0, 1) != "." && !is_dir("$statsdir"."/"."$file") && substr($file, 0, 1) != "w" && substr($file, 0, 1) != "i") $app->system->copy("$statsdir"."/"."$file", "$statsdirold"."$file");
178+
if (substr($file, 0, 1) != "." && !is_dir("$statsdir"."/"."$file") && substr($file, 0, 1) != "w" && substr($file, 0, 1) != "i") $app->system->move("$statsdir"."/"."$file", "$statsdirold"."$file");
176179
}
177180
}
178181

0 commit comments

Comments
 (0)