Created
October 28, 2016 04:42
-
-
Save pingyen/81b93c74eb1b977da6d800a090f5ba0c to your computer and use it in GitHub Desktop.
Tar each directory separately
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 | |
foreach (scandir('.') as $dir) { | |
if ($dir[0] === '.' || is_dir($dir) === false) { | |
continue; | |
} | |
shell_exec("tar zcvf $dir.tgz $dir"); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment