annotate backup_repositories.sh @ 14:49461857ed79

fix log name for rm
author Vadim Filimonov <fffilimonov@yandex.ru>
date Thu, 28 Jul 2022 16:28:27 +0300
parents 92a0646e38b6
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;