Using Git to backup moodledata: Różnice pomiędzy wersjami

Z MoodleDocs
Skocz do:nawigacja, szukaj
mNie podano opisu zmian
Nie podano opisu zmian
Linia 1: Linia 1:
{{Draft}}
[[GIT]] is a distributed source code management system. For the purpose of this document, GIT's basic feature is that it allows to keep the whole history of a directory tree and track all changes. The basic idea of using GIT as a backup tool is that you can clone you moodledata directory on other disk and/or computer.
[[GIT]] is a distributed source code management system. For the purpose of this document, GIT's basic feature is that it allows to keep the whole history of a directory tree and track all changes. The basic idea of using GIT as a backup tool is that you can clone you moodledata directory on other disk and/or computer.


Transform your moodledata into the git repository:
Transform your moodledata into the git repository:


cd /srv/www/moodledata
  git init
  git init
  git add .
  git add .
  git commit -m "Initial commit of moodledata"
  git commit -m "Initial commit of moodledata"


Put following commands into the cronjob
cd /srv/www/moodledata
git add .
git commit -a -m "AUTO: committed changes in moodledata"


Create a backup clone on local machine, e.g. on a separate disk
Create a backup clone on local machine, e.g. on a separate disk


  git clone --no-hardlinks --bare /srv/www/data/moodle_cz/.git datamoodle_cz.git
cd /mnt/backup
  git clone --no-hardlinks --bare /srv/www/moodledata/.git datamoodle.git
 
 
Push changes into a bare clone
 
cd /srv/www/moodledata
git push /mnt/backup/datamoodle.git

Wersja z 08:28, 8 kwi 2008

Szablon:Draft

GIT is a distributed source code management system. For the purpose of this document, GIT's basic feature is that it allows to keep the whole history of a directory tree and track all changes. The basic idea of using GIT as a backup tool is that you can clone you moodledata directory on other disk and/or computer.

Transform your moodledata into the git repository:

cd /srv/www/moodledata
git init
git add .
git commit -m "Initial commit of moodledata"

Put following commands into the cronjob

cd /srv/www/moodledata
git add .
git commit -a -m "AUTO: committed changes in moodledata"

Create a backup clone on local machine, e.g. on a separate disk

cd /mnt/backup
git clone --no-hardlinks --bare /srv/www/moodledata/.git datamoodle.git


Push changes into a bare clone

cd /srv/www/moodledata
git push /mnt/backup/datamoodle.git