icrc sync: add two way sync
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 9s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 9s
This commit is contained in:
parent
6f3a4954c4
commit
3433cead34
1 changed files with 14 additions and 1 deletions
13
icrc-sync
13
icrc-sync
|
|
@ -1,10 +1,23 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "$0 (from|to)"
|
||||||
|
echo "syncing from or to it ..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
fromto=$1; shift
|
||||||
|
|
||||||
dir=/mnt/c/Users/A090964/vcs/
|
dir=/mnt/c/Users/A090964/vcs/
|
||||||
repolist=$(ssh icrcnb "cd $dir; ls -1")
|
repolist=$(ssh icrcnb "cd $dir; ls -1")
|
||||||
echo $repolist
|
echo $repolist
|
||||||
|
|
||||||
cd ~/vcs
|
cd ~/vcs
|
||||||
for repo in $repolist; do
|
for repo in $repolist; do
|
||||||
|
if [ "$fromto" = "from" ]; then
|
||||||
rsync -av --delete icrcnb:${dir}/${repo}/ ~/vcs/icrc-${repo}
|
rsync -av --delete icrcnb:${dir}/${repo}/ ~/vcs/icrc-${repo}
|
||||||
|
fi
|
||||||
|
if [ "$fromto" = "to" ]; then
|
||||||
|
rsync -av --delete ~/vcs/icrc-${repo}/ icrcnb:${dir}/${repo}/
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue