2

I would like to understand more about Complete GIT backup in Server on everyday or weekly basis. I have tried the @VonC fully and incremental backup script 'sbin/save_bundles', mentioned in this answer, which gives the following error.

Error message:

./test.sh : line 7 : /home/.bashr : No such file or directory
./test.sh : line 69 : /home/sbin/usrcmd/get_hostname : No such file or directory
./test.sh : line 70 : get_hostname : command not found
./test.sh : line 71 : /home/sbin/usrcmd/get_fqn : No such file or directory
./test.sh : line 72 : get_fqn : command not found
Community
  • 1
  • 1

1 Answers1

2

The save_bundles script (that I mentioned in "How do I connect a COPY (an archive, not a clone) of a git repository to its remote?" and "Transferring changes made to multiple branches using git-bundle") requires some settings to work.

$H should be set to a folder where:

  • repositories (the folder where all your bare repos reside) is
  • backup_xxx (the folder where the bundles are stored) will be above $H

See sources:

repos="${H}/repositories"
bkp="${H}/../backups"

(make sure to consider the latest version of that script)

Sourcing the .bashrc (done in line 8) is not mandatory (it is in my environment, but not in yours)

You would also need the utility functions get_fqn and get_hostname ins $H/sbin/usrcmd.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • let me try on this. Thanks. – momsfoodfactory Jun 17 '15 at 12:24
  • assume that my Gitolite server is in ubuntu12.04 (Primairy server), it has all my bare remote repo's is in under gitadmin user /gitadmin/repositories/ there are 200 developers everyday they commit theiry changes from client to gitolite server.. so all the repo's needs to be backedup from (primary server ubunut 12.04 192.168.xxx.xxx) to (secondary server ubunu 14.0 192.168.yyy.yyy) on daily basis cron.. let me help on this.. – momsfoodfactory Jun 17 '15 at 12:31
  • suppose my primary server goes down or crash my entire source code will be lost.. safer side i want to backup my all repo's to secondary server and third external hard drive.. if any distaster in the primary i can get it from secondary or third external drive and restore the data so that my development activity wont affect and source will be safe.. to achive this i have tried your full and incremental backup.. please advice how can i achive this.. – momsfoodfactory Jun 17 '15 at 12:37
  • to achive this i need a script or modified one.. please help me to do that . – momsfoodfactory Jun 17 '15 at 12:40
  • @momsfoodfactory this script is for compressing all the repos in bundles (one file per repo). You would still need to save those bundle files elsewhere (this is not included in the backup script) – VonC Jun 17 '15 at 15:34