Last active
December 15, 2015 15:39
-
-
Save necromant2005/5283621 to your computer and use it in GitHub Desktop.
extract *.gz files and remove error logs for the next step
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dir = __DIR__ . "/nginx"; | |
foreach (new DirectoryIterator($dir) as $item) { | |
if (!$item->isFile()) continue; | |
if (strpos($item, 'access')===false) { | |
unlink($item->getPathname()); | |
continue; | |
} | |
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