Created
January 14, 2018 15:18
-
-
Save nemke82/c13cf49b264e72bd31bd8701a4904d96 to your computer and use it in GitHub Desktop.
async-reindex-m2.pl
This file contains hidden or 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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Cwd qw( abs_path ); | |
use File::Basename qw( dirname ); | |
my $pwd = dirname(abs_path($0)); | |
my @indexers = `/usr/bin/php70 $pwd/bin/magento indexer:info | awk {'print \$1'}`; | |
my $count = @indexers; | |
my $i = 0; | |
foreach my $indexer(@indexers) { | |
print "Starting $indexer in Screen\n"; | |
`/usr/bin/screen -mdS screen$i /usr/bin/php70 $pwd/bin/magento indexer:reindex $indexer`; | |
$i++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment