Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 24 lines (20 sloc) 976 Bytes
# Script to create daily backups of the Koha database.
# Based on a script by John Pennington
KOHA_DATE=`date '+%y%m%d'`
mysqldump --single-transaction -u koha -ppassword koha > $KOHA_DUMP &&
gzip -f $KOHA_DUMP &&
# Creates the dump file and compresses it;
# -u is the Koha user, -p is the password for that user.
# The -f switch on gzip forces it to overwrite the file if one exists.
mv $KOHA_BACKUP /home/kohaadmin &&
chown kohaadmin.users /home/kohaadmin/koha-$KOHA_DATE.dump.gz &&
chmod 600 /home/kohaadmin/koha-$KOHA_DATE.dump.gz &&
# Makes the compressed dump file property of the kohaadmin user.
# Make sure that you replace kohaadmin with a real user.
echo "$KOHA_BACKUP was successfully created." | mail kohaadmin -s $KOHA_BACKUP ||
echo "$KOHA_BACKUP was NOT successfully created." | mail kohaadmin -s $KOHA_BACKUP
# Notifies kohaadmin of (un)successful backup creation
Jump to Line
Something went wrong with that request. Please try again.