Storage of Perl Scripts [Was: Orphaned Authority Records: Finding Them and Deleting Them]
Hello, all! In a recent exchange, on 5 Aug. 2020, at 12:54 AM, I received the following response to my earlier inquiry about orphaned authority records: Did you try the script misc/migration_tools/remove_unused_authorities.pl?
I have looked for this on our Linux box, but I cannot find it. In fact, I cannot find any Perl script. Where are they kept? The Koha-Community.org website has not been helpful to me in this regard. Thank you for your help in this matter. P. S. We are running Koha 20.05 on Debian 10.4 ("Stretch"). -- 気を付けて。 /ki wo tukete/ = Take care. -- Charles. Charles Kelley, MLS PSC 704 Box 1029 APO AP 96338 Charles Kelley Tsukimino 1-Chome 5-2 Tsukimino Gaadenia #210 Yamato-shi, Kanagawa-ken 〒242-0002 JAPAN +1-301-741-7122 [US cell] +81-80-4356-2178 [JPN cell] mnogojazyk@aol.com [h] cmkelleymls@gmail.com [p] linkedin.com/in/cmkelleymls <http://www.linkedin.com/in/cmkelleymls> Meeting Your Information Needs. Virtually.
Hi Charles You can use "locate" command to find files in linux #sudo updatedb (Updates locate index) #sudlo locate remove_unused_authorities.pl the script mentioned is in #/usr/share/koha/bin/migration_tools/ For running you can go to that dir and do: # sudo koha-shell YOURLIBRARY_INSTANCE This will change user environment to your koha user/instance # ./remove_unused_authorities.pl --test | grep -i delete (note the dot at the beginning if the string) The grep command helps you filter only the ones that can be deleted instead of all the authorities. # ./remove_unused_authorities.pl --test | grep -i delete > /PathToAFIle/filename This will write all found records to file /PathToAFIle/filename. You should have write privileges on destination folder for your kohaUser so you can try /temp/orphanauthors.txt You can also just do: # ./remove_unused_authorities.pl to see what options the command has like delete orphaned records and check only certain types of authorities. At the end type "exit" to return to your normal linux user. Note that the script is CPU consuming. Hope helps Regards Alvaro |----------------------------------------------------------------------------------------| Stay safe / Cuídate/ Reste sécurisé *7* Switch off as you go / Apaga lo que no usas / Débranchez au fur et à mesure. *q *Recycle always / Recicla siempre / Recyclez toujours P Print only if absolutely necessary / Imprime solo si es necesario / Imprimez seulement si nécessaire Le mar. 4 août 2020 à 20:44, Charles Kelley <cmkelleymls@gmail.com> a écrit :
Hello, all!
In a recent exchange, on 5 Aug. 2020, at 12:54 AM, I received the following response to my earlier inquiry about orphaned authority records:
Did you try the script misc/migration_tools/remove_unused_authorities.pl?
I have looked for this on our Linux box, but I cannot find it. In fact, I cannot find any Perl script. Where are they kept? The Koha-Community.org website has not been helpful to me in this regard.
Thank you for your help in this matter.
P. S. We are running Koha 20.05 on Debian 10.4 ("Stretch").
--
気を付けて。 /ki wo tukete/ = Take care.
-- Charles.
Charles Kelley, MLS PSC 704 Box 1029 APO AP 96338
Charles Kelley Tsukimino 1-Chome 5-2 Tsukimino Gaadenia #210 Yamato-shi, Kanagawa-ken 〒242-0002 JAPAN
+1-301-741-7122 [US cell] +81-80-4356-2178 [JPN cell]
mnogojazyk@aol.com [h] cmkelleymls@gmail.com [p]
linkedin.com/in/cmkelleymls <http://www.linkedin.com/in/cmkelleymls> Meeting Your Information Needs. Virtually. _______________________________________________
Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
Hello, Alvaro! In our latest exchange, on 5 Aug. 2020, at 11:00 AM, you wrote: You can use "locate" command to find files in linux
#sudo updatedb (Updates locate index) #sudlo locate remove_unused_authorities.pl
bash reports that neither updatedb nor locate exists. At least, neither exists in Debian Stretch.
the script mentioned is in
#/usr/share/koha/bin/migration_tools/
Thank you. I finally found the Perl scripts that come with the initial Koha installation. For running you can go to that dir and do:
# sudo koha-shell YOURLIBRARY_INSTANCE This will change user environment to your koha user/instance
# ./remove_unused_authorities.pl --test | grep -i delete (note the dot at the beginning if the string) The grep command helps you filter only the ones that can be deleted instead of all the authorities.
# ./remove_unused_authorities.pl --test | grep -i delete > /PathToAFIle/filename This will write all found records to file /PathToAFIle/filename. You should have write privileges on destination folder for your kohaUser so you can try /temp/orphanauthors.txt
You can also just do:
# ./remove_unused_authorities.pl to see what options the command has like delete orphaned records and check only certain types of authorities.
However, when I tried executing it, I got an error message, to wit: BEGIN failed--compilation aborted at ./remove_unused_authories.pl line 25.
I guess we'll just have to live with the orphaned authority records for the present. At the end type "exit" to return to your normal linux user.
Note that the script is CPU consuming.
Thank you for the advisement. We'll run it after closing so that the disruption will be minimal. Hope helps
Thanks. -- 気を付けて。 /ki wo tukete/ = Take care. -- Charles. Charles Kelley, MLS PSC 704 Box 1029 APO AP 96338 Charles Kelley Tsukimino 1-Chome 5-2 Tsukimino Gaadenia #210 Yamato-shi, Kanagawa-ken 〒242-0002 JAPAN +1-301-741-7122 [US cell] +81-80-4356-2178 [JPN cell] mnogojazyk@aol.com [h] cmkelleymls@gmail.com [p] linkedin.com/in/cmkelleymls <http://www.linkedin.com/in/cmkelleymls> Meeting Your Information Needs. Virtually.
Hi Charles for the locate/updatdb commands, you can install it with # sudo apt-get install locate. You need to first run sudo updatedb before the sudo locate so your file index is updated before your search About the error, have you accessed your koha user shell before running it? Else you can try # perl ./remove_unused_authories.pl Regards, Alvaro |----------------------------------------------------------------------------------------| Stay safe / Cuídate/ Reste sécurisé *7* Switch off as you go / Apaga lo que no usas / Débranchez au fur et à mesure. *q *Recycle always / Recicla siempre / Recyclez toujours P Print only if absolutely necessary / Imprime solo si es necesario / Imprimez seulement si nécessaire Le mar. 4 août 2020 à 21:36, Charles Kelley <cmkelleymls@gmail.com> a écrit :
Hello, Alvaro!
In our latest exchange, on 5 Aug. 2020, at 11:00 AM, you wrote:
You can use "locate" command to find files in linux
#sudo updatedb (Updates locate index) #sudlo locate remove_unused_authorities.pl
bash reports that neither updatedb nor locate exists. At least, neither exists in Debian Stretch.
the script mentioned is in
#/usr/share/koha/bin/migration_tools/
Thank you. I finally found the Perl scripts that come with the initial Koha installation.
For running you can go to that dir and do:
# sudo koha-shell YOURLIBRARY_INSTANCE This will change user environment to your koha user/instance
# ./remove_unused_authorities.pl --test | grep -i delete (note the dot at the beginning if the string) The grep command helps you filter only the ones that can be deleted instead of all the authorities.
# ./remove_unused_authorities.pl --test | grep -i delete > /PathToAFIle/filename This will write all found records to file /PathToAFIle/filename. You should have write privileges on destination folder for your kohaUser so you can try /temp/orphanauthors.txt
You can also just do:
# ./remove_unused_authorities.pl to see what options the command has like delete orphaned records and check only certain types of authorities.
However, when I tried executing it, I got an error message, to wit:
BEGIN failed--compilation aborted at ./remove_unused_authories.pl line 25.
I guess we'll just have to live with the orphaned authority records for the present.
At the end type "exit" to return to your normal linux user.
Note that the script is CPU consuming.
Thank you for the advisement. We'll run it after closing so that the disruption will be minimal.
Hope helps
Thanks.
--
気を付けて。 /ki wo tukete/ = Take care.
-- Charles.
Charles Kelley, MLS PSC 704 Box 1029 APO AP 96338
Charles Kelley Tsukimino 1-Chome 5-2 Tsukimino Gaadenia #210 Yamato-shi, Kanagawa-ken 〒242-0002 JAPAN
+1-301-741-7122 [US cell] +81-80-4356-2178 [JPN cell]
mnogojazyk@aol.com [h] cmkelleymls@gmail.com [p]
linkedin.com/in/cmkelleymls <http://www.linkedin.com/in/cmkelleymls> Meeting Your Information Needs. Virtually.
Hello, Alvaro et al! In our latest exchange, on 6 Aug. 2020, at 3:30 AM, you wrote: for the locate/updatdb commands, you can install it with
# sudo apt-get install locate.
You need to first run sudo updatedb before the sudo locate so your file index is updated before your search
About the error, have you accessed your koha user shell before running it?
Else you can try
# perl ./remove_unused_authories.pl
Yes, I finally got everything to work. I had to use # apt-get install sudo when I installed Stretch because sudo is missing from the installation package.* I just couldn't remember the installation command line. It also doesn't help matters that the wi-fi signal is unsteady at times. You live by technology, you die by technology, I suppose. In any event, after I installed locate, everything worked. Now, if there were a way to automate merging duplicate authority records together, e.g., 651 \0‡aChina‡vMaps strewn over multiple records into one authority record, that would be great. Thanks for your help. Footnote * Don't ask me why sudo is missing from Stretch, but there is widespread flabbergast over its loss since sudo is such a basic and useful command. sudo is reinstated in Buster, however. -- 気を付けて。 /ki wo tukete/ = Take care. -- Charles. Charles Kelley, MLS PSC 704 Box 1029 APO AP 96338 Charles Kelley Tsukimino 1-Chome 5-2 Tsukimino Gaadenia #210 Yamato-shi, Kanagawa-ken 〒242-0002 JAPAN +1-301-741-7122 [US cell] +81-80-4356-2178 [JPN cell] mnogojazyk@aol.com [h] cmkelleymls@gmail.com [p] linkedin.com/in/cmkelleymls <http://www.linkedin.com/in/cmkelleymls> Meeting Your Information Needs. Virtually.
participants (2)
-
Alvaro Cornejo -
Charles Kelley