File tree Expand file tree Collapse file tree 2 files changed +75
-0
lines changed Expand file tree Collapse file tree 2 files changed +75
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # Invoke rsync directly, via SSH
4+
5+ if [ $# -ne 3 ]
6+ then
7+ echo " Error: not enough arguments!"
8+ echo " Usage is: $0 r_src r_dest r_logfile"
9+ exit 2
10+ fi
11+
12+ R_SRC=$1
13+ R_DEST=$2
14+ R_LOGFILE=$3
15+
16+ # Options:
17+
18+ R_OPTIONS=" -rltgoDhv --delete-during --inplace --progress --log-file=" ${R_LOGFILE}
19+
20+ # Files to exclude:
21+
22+ R_EXCLUDE=" --exclude vmware.log --exclude vmware-*.log --exclude @eaDir/ --exclude @eaDir --exclude Thumbs.db"
23+
24+ echo " +---------------------------------------------------------------------------------" | tee -a ${R_LOGFILE}
25+ echo " + $( date) : Copy $R_SRC to $R_DEST " | tee -a ${R_LOGFILE}
26+ echo " +---------------------------------------------------------------------------------" | tee -a ${R_LOGFILE}
27+ rsync ${R_OPTIONS} ${R_EXCLUDE} -e " ssh -T -c none -o Compression=no -x" ${R_SRC} ${R_DEST}
28+ echo " + $( date) Transfer completed" | tee -a ${R_LOGFILE}
29+ exit
30+
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ if [ $# -ne 3 ]
4+ then
5+ echo " Error: not enough arguments!"
6+ echo " Usage is: $0 r_src r_dest r_logfile"
7+ exit 2
8+ fi
9+
10+ R_SRC=$1
11+ R_DEST=$2
12+ R_LOGFILE=$3
13+
14+ # Options:
15+ # -r recurse into directories
16+ # -l copy symlinks as symlinks
17+ # -t preserve modification times
18+ # -g preserve group
19+ # -o preserve owner
20+ # -D preserve device and special files
21+ # -h human readable progress
22+ # -v increase verbosity
23+
24+ # --delete-during receiver deletes during the transfer
25+ # --inplace write updated data directly to destination file
26+ # --log-file specify log file
27+
28+ R_OPTIONS=" -rltgoDhv --delete-during --inplace --progress --log-file=" ${R_LOGFILE}
29+
30+ # Files to exclude:
31+ # vmware.log VMware virtual machine log files
32+ # vmware-*.log
33+ # @eaDir/ Synology extended attributes (?)
34+ # @eaDir
35+ # Thumbs.db Windows system files
36+
37+ R_EXCLUDE=" --exclude vmware.log --exclude vmware-*.log --exclude @eaDir/ --exclude @eaDir --exclude Thumbs.db"
38+
39+ echo " +---------------------------------------------------------------------------------" | tee -a ${R_LOGFILE}
40+ echo " + $( date) : Copy $R_SRC to $R_DEST " | tee -a ${R_LOGFILE}
41+ echo " +---------------------------------------------------------------------------------" | tee -a ${R_LOGFILE}
42+ rsync ${R_OPTIONS} ${R_EXCLUDE} ${R_SRC} rsync://${R_DEST}
43+ echo " + $( date) Transfer completed" | tee -a ${R_LOGFILE}
44+ exit
45+
You can’t perform that action at this time.
0 commit comments