Skip to content

Commit 317c9fe

Browse files
authored
Add files via upload
1 parent 2242aff commit 317c9fe

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

rsync-invoke.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+

rsync-module.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+

0 commit comments

Comments
 (0)