Tuesday, November 16, 2021

DSpace Autobackup

 #!/bin/bash

PGPASSWORD="dspace" pg_dump -U dspace -h localhost -Fc dspace | gzip > dspace_backup/dspace-$(date +%Y-%m-%d-%H.%M.%S).sql.gz

now=$(date +"%d_%m_%Y")

zip -r  /home/koha/dspace_backup/$now-assetstore.zip /dspace/assetstore

Friday, July 9, 2021

Installing Tomcat

cd /opt && sudo wget https://mirrors.estointernet.in/apache/tomcat/tomcat-9/v9.0.50/bin/apache-tomcat-9.0.50.tar.gz


sudo tar xvzf apache-tomcat-9.0.50.tar.gz

sudo mv apache-tomcat-9.0.50 tomcat

sudo gedit /etc/profile

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export CATALINA_HOME=/opt/tomcat

 

sh /opt/tomcat/bin/shutdown.sh

sh /opt/tomcat/bin/startup.sh

  



Friday, February 12, 2021

Import large sql file in Phpmyadmin on Ubuntu 20.04 (Debian9)

If try to import large SQL (MySqL) file and take long lime or fail to work.

Try the bellow steps:

Create an 'Upload' and a 'save' directories for PhpMyadmin

mkdir /etc/phpmyadmin/upload 

mkdir /etc/phpmyadmin/save 

chmod a+w /etc/phpmyadmin/upload 

chmod a+w /etc/phpmyadmin/save

Then edit phpmyadmin's config file: 

sudo nano /etc/phpmyadmin/config.inc.php

add absolute path for both 'upload' and 'save' directories:

$cfg['UploadDir'] = '/etc/phpmyadmin/upload'; 

$cfg['SaveDir'] = '/etc/phpmyadmin/save';

Now copy the koha_library.sql file to [/etc/phpmyadmin/upload]

cp /your koha_library.sql file/   /etc/phpmyadmin/upload/

sudo chmod 777 /etc/phpmyadmin/upload/koha_library.sql

Timeout error in phpMyAdmin during import database from file

Open the (config.inc.php) file and add the following anywhere in the file
$cfg['Servers'] [$i] ['LoginCookieValidity'] = 72000;

and 

Open (search code using F6 in nano editor)

nano /usr/share/phpmyadmin/libraries/config.default.php

$cfg['ExecTimeLimit'] = 300; Make it to

$cfg['ExecTimeLimit'] = 0;

Restart Apache2 

service apache2 restart


                                                           

Thursday, February 11, 2021

How do I uninstall MySQL completely from ubuntu/Debian

sudo -i

service mysql stop


killall -KILL mysql mysqld_safe mysqld


apt-get --yes purge mysql-server mysql-client


apt-get --yes autoremove --purge


apt-get autoclean


deluser --remove-home mysql


delgroup mysql



sudo rm -rf /var/lib/mysql 

 

sudo apt-get remove --purge *mysql\*


sudo apt-get autoremove


sudo apt-get autoclean 




Tuesday, January 12, 2021

MySQL Autobackup of Koha in Debian/Ubuntu


I am showing you the easiest way to keep automate your koha db backupthat is the combination of MySQL Dumps and a cronjob.

Create a file called mysqldump.sh

mkdir /home/debian/backup/mysqldump.sh

copy the bellow line.

mysqldump -uroot -p******* koha_library | gzip > /home/debian/backup/koha_`date +%F`.sql.gz

save it

Test the script

 chmod +x /home/debian/backup/mysqldump.sh

Create and schedule a new cron job

Execute the script:

 sh /home/debian/backup/mysqldump.sh

And add the following line at the bottom of crontab -e

 30 23 * * * /home/debian/backup/mysqldump.sh

(This will execute the script every day at 23:30.)

------------------------------PERIODIC REMOVAL OF FILES--------------------------

tested on Debian/UBUNTU

  nano /home/debian/backup/mysqldump.sh

Add the line at the end: (this script will remove your Koha backfiles after 7 days)

  find /home/debian/backup/koha* -type f -mtime +7 -exec rm {}

--------------------------Auto Restart Mysql service------------------------------------------

And add the following line at the bottom of crontab -e 

30 23 * * * systemctl is-active  || systemctl start mysql.service

This will run every midnight at 11.30PM



Installing Koha 23.05 on ubuntu

apt update sudo apt-get -y install sudo wget gnupg wget -q -O- https://debian.koha-community.org/koha/gpg.asc | sudo apt-key add - sudo apt...