[Koha] koha backup

Wojciech Zatorski listy-in at zatorski.net
Sun Jul 22 21:31:05 NZST 2007


Hello mohamed,

Sunday, July 22, 2007, 10:38:26 AM, you wrote:

mf> hi
mf> i want to take backup from my koha databaes any one can help me ? thanx

for example, create file backup.sh:,
touch /sbin/backup.sh
chmod 755 /bin/backup.sh
mcedit /bin/basckup.sh

#!/bin/bash
TIMESTAMP=`date +%m-%d-%y-%H%M`

echo "Archiwizacja danych...";

# Where save backup
cd /archiv

# delete old backup (14 days old)
find /archiv/*.tar.gz -mtime +14 -exec rm -f {} \;

# create backup for database
# my database KOHA224_BIBL (smieciucha)
DBNAME=Koha224_bibl
mysqldump -l --opt -c -e -Q --single-transaction --flush-logs -u root $DBNAME > $DBNAME.sql
tar czpf $DBNAME.$TIMESTAMP.tar.gz $DBNAME.sql
rm -f $DBNAME.sql
#==============END_OF_FILE====================


bye

-- 
The Main Library of Szczecin University.
Computerization Department.
http://bg.univ.szczecin.pl



More information about the Koha mailing list