Skip to content

Commit

Permalink
Mon May 28 01:23:25 +07 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
hyphop committed May 27, 2018
1 parent 532d3e5 commit 6fcaca9
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ logs
,tmp/*
tools.bin/*
git_*
syncit*
rel
66 changes: 66 additions & 0 deletions syncit
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/sh

## hyphop ##

## hyphop GIT sync
## for local usage only

## USAGE

## $0 - check
## $0 yes - sync inc
## $0 yes del - sync del mode
##

B=`dirname "$0"`

[ "$B" = "." ] && B=$PWD
S=`dirname "$B"`
F=`basename "$B"`

. $B/syncit.conf

D=`dirname "$DST"`
N=`basename "$DST"`

[ "$1" ] || {
ARGS="$ARGS -n"
}

YES=
[ "$1" = "yes" ] && {
YES=1
shift
}

##

[ "$1" = "del" ] && {
shift
ARGS="$ARGS --delete"
[ "$YES" ] || {
ARGS="$ARGS -n"
}

}


echo "[i] $S // $F =>\n $D // $N" >&2
echo rsync -av $ARGS "$@" \
--exclude=.git/* \
"$S/$F" \
"$D"

[ "$DRY" ] && {
echo "[i] DRY run" >&2
exit 0
}

rsync -av $ARGS "$@" \
--exclude=.git/* \
"$S/$F" \
"$D"

[ "$YES" ] || {
echo "[i] USAGE $0 yes @ARGS // for sync write " >&2
}
10 changes: 10 additions & 0 deletions syncit.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
DST=/mnt/temp/githup/hyphop/miZy-linux-kernel
ARGS="
--exclude=*-mizy*/ \
--exclude=*-mizy*/* \
--exclude=*-mizy/* \
--exclude=logs/* \
--exclude=bin/* \
--exclude=.git \
"

0 comments on commit 6fcaca9

Please sign in to comment.