3 #rsync-all.sh-- _describe_
5 #@Created: 2011-04-02-11:49
7 PATH
=/usr
/local
/bin
:/bin
:/usr
/bin
17 echo "Usage: $PROGRAM [--all] [--list] [--athome|-m] [--mode|-o <put|get|put-update|get-update>] [--dry|-n] <--tohost|-t> [--help] [--version] [the component...]"
19 echo -e "\trsync-all.sh -a -t ip98:"
20 echo -e "\trsync-all.sh -t ip98: update"
21 echo -e "\trsync-all.sh -t ip98: fox"
23 echo -e "\trsync-all.sh -t ip98:/cygdrive/h/li\@58 update"
24 echo -e "\trsync-all.sh -t ip98:/cygdrive/h/li\@58 local-backup"
25 #echo "rsync to 67.195 at localhost: by port 32195"
26 #echo -e "\trsync-all.sh localhost: qa 32195"
27 echo "rsync to ip 108"
28 echo -e "\trsync-all.sh -t 192.168.1.108: update"
29 echo "rsync to local path /cygdrive/h"
30 echo -e "\trsync-all.sh -t /cygdrive/h update"
31 echo "rsync to tu58 for get update and just test"
32 echo -e "\trsync-all.sh -o get -n -t tu58: update"
43 echo "$PROGRAM version $VERSION"
49 EXITCODE
=$
((EXITCODE
+ 1))
50 #EXITCODE=`expr $EXITCODE + 1`
66 if [ $hostname = "football12" ]
105 error
"Unrecognized option: $1"
114 #----------- end of phrase argument ---------------#
123 echo rsync $
* $host1 $host2
124 rsync $
* $host1 $host2
134 echo rsync $
* $host2 $host1
135 rsync $
* $host2 $host1
138 if [ "$all" = "list" ]
140 echo -e "componets:\n\tupdate: /e/update /e/ori\n\tfox: /l/scrapbook/\n\tmiranda\n\tlb: /l/local-backup/\n\t"
147 error
"tohost must set!!!"
153 echo "use all setting, means sync update and fox"
154 componets
="update fox"
158 error
"component or -a must set!!!"
165 # -a: archive mode, equivalent to -rlptgoD
166 # -v: increase verbosity
167 # -z: compress file data
168 # --delete: This tells rsync to delete any files on the receiving side that aren't on the send-ing side
171 echo "use mode put and delete"
176 echo "use mode get and delete"
181 echo "use mode put and update and not delete"
186 echo "use mode get and update and not delete"
196 if [ $dry == "true" ]
198 ARGU
="$ARGU --dry-run"
206 echo "in update component..."
207 # can use i again at here ???
211 $rsync_func /e
/ori
/ $j/e
/ori
/ $ARGU
212 $rsync_func /e
/update
/ $j/e
/update
/ $ARGU
216 echo "in fox component ..."
220 $rsync_func /l
/scrapbook
/ $j/l_disk
/scrapbook
/ $ARGU
221 $rsync_func $HOME/syncplaces.json
$j/e
/home
/$user/syncplaces.json
$ARGU
222 $rsync_func $HOME/syncplaces.json.sha1
$j/e
/home
/$user/syncplaces.json.sha1
$ARGU
223 $rsync_func /d
/temp.txt
$j/d
/temp.txt
$ARGU
227 echo "in miranda componet ..."
231 $rsync_func /d
/prog
/miranda-ing
/ $j/d
/prog
/miranda-ing
/ $ARGU
235 echo "in local-backup componet ..."
239 $rsync_func /l
/local-backup
/ $j/e
/l_disk
/local-backup
/ $ARGU
243 echo "in $i component ..."
247 $rsync_func $i/ $j$i/ $ARGU