-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hyphop
committed
May 27, 2018
1 parent
532d3e5
commit 6fcaca9
Showing
3 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,4 @@ logs | |
,tmp/* | ||
tools.bin/* | ||
git_* | ||
syncit* | ||
rel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \ | ||
" |