-
Notifications
You must be signed in to change notification settings - Fork 4
/
rsync-invoke.sh
28 lines (20 loc) · 875 Bytes
/
rsync-invoke.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# Invoke rsync directly, via SSH
if [ $# -ne 3 ]; then
echo "Error: not enough arguments!"
echo "Usage is: $0 r_src r_dest r_logfile"
exit 2
fi
R_SRC=$1
R_DEST=$2
R_LOGFILE=$3
# Options:
R_OPTIONS="-rltgoDhv --delete-during --inplace --progress --log-file="${R_LOGFILE}
# Files to exclude:
R_EXCLUDE="--exclude vmware.log --exclude vmware-*.log --exclude @eaDir/ --exclude @eaDir --exclude Thumbs.db"
echo "+---------------------------------------------------------------------------------" | tee -a "${R_LOGFILE}"
echo "+ $(date): Copy $R_SRC to $R_DEST" | tee -a "${R_LOGFILE}"
echo "+---------------------------------------------------------------------------------" | tee -a "${R_LOGFILE}"
rsync ${R_OPTIONS} ${R_EXCLUDE} -e "ssh -T -c none -o Compression=no -x" ${R_SRC} ${R_DEST}
echo "+ $(date) Transfer completed" | tee -a "${R_LOGFILE}"
exit