if args.munge:
rsync_opts.append('--munge-links')
+
+ if args.no_overwrite:
+ rsync_opts.append('--ignore-existing')
if not rsync_args:
rsync_args = [ '.' ]
arg_parser.add_argument('-munge', action='store_true', help="Enable rsync's --munge-links on the server side.")
arg_parser.add_argument('-no-del', action='store_true', help="Disable rsync's --delete* and --remove* options.")
arg_parser.add_argument('-no-lock', action='store_true', help="Avoid the single-run (per-user) lock check.")
+ arg_parser.add_argument('-no-overwrite', action='store_true', help="Prevent overwriting existing files by enforcing --ignore-existing")
arg_parser.add_argument('-help', '-h', action='help', help="Output this help message and exit.")
arg_parser.add_argument('dir', metavar='DIR', help="The restricted directory to use.")
args = arg_parser.parse_args()
## SYNOPSIS
```
-rrsync [-ro|-rw] [-munge] [-no-del] [-no-lock] DIR
+rrsync [-ro|-rw] [-munge] [-no-del] [-no-lock] [-no-overwrite] DIR
```
The single non-option argument specifies the restricted _DIR_ to use. It can be
Avoid the single-run (per-user) lock check. Useful with [`-munge`](#opt).
+0. `-no-overwrite`
+
+ Enforce `--ignore-existing` on the server. Prevents overwriting existing
+ files when the server is the receiver.
+
0. `-help`, `-h`
Output this help message and exit.