Skip to content

Instantly share code, notes, and snippets.

Last active Dec 15, 2015
What would you like to do?
extract *.gz files and remove error logs for the next step
$dir = __DIR__ . "/nginx";
foreach (new DirectoryIterator($dir) as $item) {
if (!$item->isFile()) continue;
if (strpos($item, 'access')===false) {
if (!strpos($item, '.gz')) continue;
system('gunzip ' . escapeshellarg($item->getPathname()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment