diff backup_repositories.sh @ 0:dfc36e7ed22c

init
author Vadim Filimonov <fffilimonov@yandex.ru>
date Thu, 12 May 2022 13:51:59 +0400
parents
children 92a0646e38b6
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/backup_repositories.sh	Thu May 12 13:51:59 2022 +0400
@@ -0,0 +1,16 @@
+#!/bin/bash -e
+
+. common.sh;
+. local/backupcredentials.sh;
+
+mkdir -p $backuphome 2>/dev/null;
+
+repos=$(curl -s http://${backupcredentials}@${domain}/private/tools/links.txt)
+
+for repo in ${repos}; do
+    if [ ! -d ${backuphome}/${repo} ]; then
+        /usr/local/bin/hg clone http://${backupcredentials}@${domain}/repo/${repo} ${backuphome}/${repo};
+    else
+        /usr/local/bin/hg pull -R ${backuphome}/${repo} -u http://${backupcredentials}@${domain}/repo/${repo};
+    fi;
+done;