Always use --mkpath and --ignore-missing-args with rsync
With --rsync-options, only -r and -v were kept, so the first backup failed because the simple_backup directory did not exist yet, and a missing input made rsync fail. Use these options in any case.
This commit is contained in:
@@ -937,12 +937,12 @@ def simple_backup() -> int:
|
||||
ssh_keyfile = args.keyfile if args.keyfile is not None else config_args['ssh_keyfile']
|
||||
remote_sudo = args.remote_sudo or config_args['remote_sudo']
|
||||
|
||||
if args.rsync_options is None:
|
||||
rsync_options = ['-a', '-r', '-v', '-h', '-H',
|
||||
'-X', '-s', '--ignore-missing-args', '--mkpath']
|
||||
else:
|
||||
rsync_options = ['-r', '-v']
|
||||
# Options needed in any case (--mkpath creates the backup directory on the first run)
|
||||
rsync_options = ['-r', '-v', '--ignore-missing-args', '--mkpath']
|
||||
|
||||
if args.rsync_options is None:
|
||||
rsync_options.extend(['-a', '-h', '-H', '-X', '-s'])
|
||||
else:
|
||||
for ro in args.rsync_options:
|
||||
rsync_options.append(f'-{ro}')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user