rmirror: Use rsync to mirror SOURCE to DEST
parent
1c39e424ef
commit
6bf16e4257
|
@ -15,4 +15,4 @@ EOF
|
|||
exit
|
||||
fi
|
||||
|
||||
rsync -ivr --append-verify --progress -- "$@"
|
||||
rsync -livr --append-verify --progress -- "$@"
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
opt_dry=""
|
||||
if [ "$1" = "-n" ]; then
|
||||
opt_dry="-n"
|
||||
shift
|
||||
fi
|
||||
|
||||
if [ "$1" = "-h" ] || [ $# -ne 2 ]; then
|
||||
cat<<EOF
|
||||
Usage: ${0##*/} SOURCE DEST
|
||||
|
||||
Use rsync to mirror SOURCE to DEST while showing progress and allowing resuming.
|
||||
SOURCE does not need to be ending with a trailing slash. Only size is used for
|
||||
comparison.
|
||||
|
||||
Options:
|
||||
|
||||
-n: Dry-run.
|
||||
|
||||
EOF
|
||||
|
||||
exit
|
||||
fi
|
||||
|
||||
rsync "$opt_dry" -livr --size-only --delete-excluded --append-verify --progress -- "$1"/ "$2"
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "$1" = "-h" ] || [ $# -ne 2 ]; then
|
||||
cat<<EOF
|
||||
Usage: ${0##*/} FOLDER1 FOLDER2
|
||||
|
||||
Dry-run of rsync over two folders.
|
||||
|
||||
EOF
|
||||
|
||||
exit
|
||||
fi
|
||||
|
||||
rsync -nivr --size-only --delete-excluded "$1"/ "$2"
|
Loading…
Reference in New Issue