annotate backup_repositories.sh @ 1:92a0646e38b6

fix backup
author fffilimonov
date Thu, 12 May 2022 05:32:53 -0500
parents dfc36e7ed22c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
1 #!/bin/bash -e
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
2
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
3 . common.sh;
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
4 . local/backupcredentials.sh;
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
5
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
6 mkdir -p $backuphome 2>/dev/null;
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
7
1
92a0646e38b6 fix backup
fffilimonov
parents: 0
diff changeset
8 repos=$(curl -sLu ${backupcredentials} http://${domain}/private/tools/links.txt)
0
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
9
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
10 for repo in ${repos}; do
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
11 if [ ! -d ${backuphome}/${repo} ]; then
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
12 /usr/local/bin/hg clone http://${backupcredentials}@${domain}/repo/${repo} ${backuphome}/${repo};
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
13 else
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
14 /usr/local/bin/hg pull -R ${backuphome}/${repo} -u http://${backupcredentials}@${domain}/repo/${repo};
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
15 fi;
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
16 done;