From: Rogan Hamby Date: Fri, 26 Jun 2020 16:39:56 +0000 (-0400) Subject: have mig-import remove memcache keys and restart plack X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=c5c0abb7a6d58b224ab67a8b0550be95f494d405 have mig-import remove memcache keys and restart plack --- diff --git a/kmig.d/bin/mig-import b/kmig.d/bin/mig-import index 0f075b5..a7df5ac 100755 --- a/kmig.d/bin/mig-import +++ b/kmig.d/bin/mig-import @@ -204,7 +204,14 @@ sub most_recent_single { sub reset_memcache { my $instance = shift; - print "instance is $instance\n"; + my $aptcheck = `sudo dpkg -l | grep 'libmemcached-tools'`; + if (!defined $aptcheck or length($aptcheck) < 1) { + print "!!! !!! !!! WARNING WARNING WARNING: libmemcached-tools is not installed, removing keys will not be attempted\n"; + return; + } + + system("sudo memcdump --servers localhost | grep '$instance:' | grep 'syspref\|MarcStructure\|AuthorisedValues\|MarcSubfieldStructure' | xargs memcrm --servers localhost"); + system("sudo koha-plack --restart $instance"); return; }