From 848d7423b4146ca03d45de2a27051d9667c5be18 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 18 Mar 2022 18:58:10 +0000 Subject: Swap git mirroring script for crontab and makefile Only does what's needed, more often, right user --- scripts/git-mirror.cron | 10 ---------- scripts/git.mirror.cron | 1 + 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100755 scripts/git-mirror.cron create mode 100644 scripts/git.mirror.cron diff --git a/scripts/git-mirror.cron b/scripts/git-mirror.cron deleted file mode 100755 index 311180a..0000000 --- a/scripts/git-mirror.cron +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -[[ $(id -u) -eq 0 ]] && exec sudo -H -u randomdan $0 $@ - -find /var/git -maxdepth 2 -name config -type f | \ - xargs grep -F '[remote "github"]' -l | \ - xargs dirname | \ - while read d - do git -C $d push -q github --mirror || echo "Mirroring $d failed" - done diff --git a/scripts/git.mirror.cron b/scripts/git.mirror.cron new file mode 100644 index 0000000..d3411e2 --- /dev/null +++ b/scripts/git.mirror.cron @@ -0,0 +1 @@ +*/5 * * * * randomdan make -sf backup.mk -C /var/git/ -- cgit v1.2.3