aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin/init/sync.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/init/sync.sh')
-rwxr-xr-xbin/init/sync.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/bin/init/sync.sh b/bin/init/sync.sh
new file mode 100755
index 0000000..bcd7bed
--- /dev/null
+++ b/bin/init/sync.sh
@@ -0,0 +1,37 @@
1#!/bin/bash
2
3# If git is working in other process, then don't sync again
4pidof git >/dev/null && exit 0
5
6# my repo
7sync() {
8 {
9 cd $1 && [[ -n `git remote -v` ]] || return
10 } 2>/dev/null
11 GIT_SSH_COMMAND="ssh -o ControlMaster=no" git pull --quiet || echo Has trouble when syncing `pwd`
12}
13sync $SETTING_DIR &
14sync ~/log &
15sync ~/blog &
16sync ~/git/vps &
17sync ~/.task &
18sync ~/.password-store &
19sync ~/.vim/vim-init &
20sync ~/bean &
21
22while true; do
23 if test $(jobs -r | wc -l) -gt 0; then
24 sleep 1;
25 else
26 which notify-send &>/dev/null && notify-send 'Repos synced'
27 break
28 fi
29done &
30
31# others repo
32#check_upstream ~/git/tig || echo in `pwd` >/dev/tty &
33
34# thunderbird
35#if [[ `cat /etc/hostname` != 'vultr' ]]; then
36# rsync -a pham@topo.tw:~/.thunderbird/ ~/.thunderbird &
37#fi