Git repository backup takes old repos as new
When backing up git repositories by doing
$ rake backup:all
already existing repos are taken as non-existent and a clone is tried
(and fails):
> Initializing new GIT repositories and updating existing ones
====> Initializing git repository git://github.com/dcobas/adctest.git
cd /home/cernohr/ohwr/production/git && git clone git://github.com/dcobas/adctest.git
fatal: destination path 'adctest' already exists and is not an empty directory.
rake aborted!
Command failed with status (128): [cd /home/cernohr/ohwr/production/git && gi...]
/home/cernohr/ohwr/production/Rakefile:141:in `init_git_repository'
(See full trace by running task with --trace)
However, a single backup:git works as expected:
[cs-864-ohrb] /home/cernohr/ohwr/production > rake --trace backup:git
(in /home/cernohr/ohwr/production)
** Invoke backup:git (first_time)
** Invoke backup:prepare_folders (first_time)
** Execute backup:prepare_folders
> Preparing local folders
mkdir -p /home/cernohr/ohwr/production/svn
warning: Insecure world writable dir /afs/cern.ch/group/pz, mode 040777
mkdir -p /home/cernohr/ohwr/production/git
mkdir -p /home/cernohr/ohwr/production/db
mkdir -p /home/cernohr/ohwr/production/redmine-files
mkdir -p /home/cernohr/ohwr/production/sympa/arc
mkdir -p /home/cernohr/ohwr/production/sympa/list_data
** Execute backup:git
> Getting git list from https://www.ohwr.org
wget -m -nd https://www.ohwr.org/git_list.txt -O /home/cernohr/ohwr/production/git_list.txt
WARNING: combining -O with -r or -p will mean that all downloaded content
will be placed in the single file you specified.
WARNING: timestamping does nothing in combination with -O. See the manual
for details.
--2010-09-06 11:47:25-- https://www.ohwr.org/git_list.txt
Resolving www.ohwr.org... 87.106.213.168
Connecting to www.ohwr.org|87.106.213.168|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 36 [text/plain]
Saving to: `/home/cernohr/ohwr/production/git_list.txt'
100%[===================================================================================================================================================================================================>] 36 --.-K/s in 0s
2010-09-06 11:47:25 (5.99 MB/s) - `/home/cernohr/ohwr/production/git_list.txt' saved [36/36]
FINISHED --2010-09-06 11:47:25--
Downloaded: 1 files, 36 in 0s (5.99 MB/s)
> Initializing new GIT repositories and updating existing ones
====> Syncing repository adctest
cd /home/cernohr/ohwr/production/git/adctest && git pull
Already up-to-date.