To backup the Koha installation directory tree you need to ensure that all your Kohafiles are being considered. Most of them are located by default in
files are located in the
1.3.1. Automating the Filesystem Backup
Here's a short Perl script that I run with
every evening. It backs up the filesystemusing
. You'll need to change some of the Configurable Variables for thescript to work in your environment. Other than that, it's pretty much ready to go -- setup
to run it nightly.
#!/usr/bin/perl -w#This script assumes that you have set up a CVS repository#that is symlinked to your installation directories. For#info on setting that up see the Koha manual "Updating Koha"#Configurable Variablesmy $koha_base = "/build/websites/openils.com/koha"; #location of Kohacvs repomy $bak_loc = "/build/backups"; #where to put backupsmy ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)= localtime(time);$year += "1900";my $date = "$year-$mon-$mday";#Backup the filesystemprint "Backing up the filesystem\n";print "Please wait ...";`rm -rf $koha_base.bak`; #remove the previous backup`cp $koha_base $koha_base.bak`; #make a new backup`tar -cvzf $bak_loc/$date-kohafilesystem.tgz $koha_base.bak`; #targzipit
1.4. Backing up the Local Operating System Configuration
It's best to write a script to perform all the local operating system configurations as youwould manually perform them to ensure that in the event of an emergency, you cansimply run the script to set everything the way you had it before.The list of possible custom configuration files for your system is unlimited, so I can justlist a few common examples that you might want to consider including as part of yourregular backup scheme:
jobs related to Koha
1.5. Storing your Backup Offsite Using scp
You may want to keep a copy of your database, filesystem and operating systemcustomizations on your production server to ease the process of restoring should theneed arise. However, what if your hard drive on that machine crashes? It's a very goodidea to store your backups on a different machine (or two or three) and it's probably agood ideal to store them in a different building too.