nsbin/icrc-sync
Nico Schottelius 704b4e3446
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 12s
updated by /home/nico/bin/sync-all-repos on bridge
2026-02-20 10:17:07 +01:00

33 lines
690 B
Bash
Executable file

#!/bin/sh
if [ $# -ne 1 ]; then
echo "$0 (from|to)"
echo "syncing from or to it ..."
exit 1
fi
cd ~/vcs
# First sync our notes repo
if [ -d ~/vcs/icrc ]; then
cd ~/vcs/icrc
git pull
else
git clone ssh://git@code.ungleich.ch/nico/icrc.git
fi
fromto=$1; shift
dir=/mnt/c/Users/A090964/vcs/
repolist=$(ssh icrcnb "cd $dir; ls -1 icrc*")
echo $repolist
for repo in $repolist; do
if [ "$fromto" = "from" ]; then
mkdir -p ~/vcs/icrc-${repo}
rsync -av --delete icrcnb:${dir}/${repo}/.git/ ~/vcs/icrc-${repo}/.git
fi
if [ "$fromto" = "to" ]; then
rsync -av --delete ~/vcs/icrc-${repo}/.git/ icrcnb:${dir}/${repo}/.git
fi
done