2025-11-14 11:17:47 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
2025-11-14 11:23:50 +01:00
|
|
|
if [ $# -ne 1 ]; then
|
|
|
|
|
echo "$0 (from|to)"
|
|
|
|
|
echo "syncing from or to it ..."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
fromto=$1; shift
|
|
|
|
|
|
2025-11-14 11:17:47 +01:00
|
|
|
dir=/mnt/c/Users/A090964/vcs/
|
|
|
|
|
repolist=$(ssh icrcnb "cd $dir; ls -1")
|
|
|
|
|
echo $repolist
|
|
|
|
|
|
|
|
|
|
cd ~/vcs
|
|
|
|
|
for repo in $repolist; do
|
2025-11-14 11:23:50 +01:00
|
|
|
if [ "$fromto" = "from" ]; then
|
|
|
|
|
rsync -av --delete icrcnb:${dir}/${repo}/ ~/vcs/icrc-${repo}
|
|
|
|
|
fi
|
|
|
|
|
if [ "$fromto" = "to" ]; then
|
|
|
|
|
rsync -av --delete ~/vcs/icrc-${repo}/ icrcnb:${dir}/${repo}/
|
|
|
|
|
fi
|
2025-11-14 11:17:47 +01:00
|
|
|
done
|