Closed bhavicp closed 12 years ago
https://www.dokuwiki.org/faq:backup says that backups is "simple and easy" and that the files simply need to be backed up.
To backup a git repository with working files we would need to use the git bundle
command.
However the directory /home/james/james.git
is a bare repository. Git bundle will not work on it, and if it is being changed at the time of the backup there could be inconsistencies[1].
It would probably also be a good time to prune the repository
There are two possible ways to address this.
Using bundles is convenient, but the files can be large since it contains the working directory as well. It also does not backup hooks in the bare repo.
git clone --mirror /home/james/james.git /home/james/backups/tmp/james-backup.git
cd /home/james/backups/tmp/james-backup.git
git bundle /home/james/backups/tmp/james.git.bdl --all
Bundles can be accessed just like a repository... they don't even need to be checked out. So restoring could go something like this:
rm -fr /home/james/james.git # be safe
git clone /home/james/backups/tmp/james.git.bdl /home/james/james.git
But from what I can see this will not allow us to rebuild a bare repo... (maybe git clone --bare james.git.bdl
?)
This way means the users hooks are backed up... which is probably important - especially if the user has added their own hooks.
git clone --bare /home/james/james.git /home/james/backups/tmp/james-backup.git
tar -czf /home/james/backups/tmp/james.git.tar.gz /home/james/backups/tmp/james-backup.git
Restoring from a tar is the classic:
/home/james/james.git # be safe
tar -xzf /home/james/backups/tmp/james.git.tar.gz -C /home/james/james.git
It is my informed decision that using option 2 is the best way to do this
For Dokuwiki as well, we would need to ignore:
.../dokuwiki/data/lock
.../dokuwiki/data/cache
Problem
James thinks that we need to lock files when backing up data to prevent inconsistencies. We need to do more research on this and do what is recommended by each software package we use that will be backed up. Currently these are:
Solution
Dokuwiki
It's as simple as backing up the files - ignoring lock files and the cache.
Git
We should clone the bare repo then tar it up.