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:
Fuxino
2026-10-08 18:08:28 +02:00
parent 7ef29cf551
commit d0f888cbb4
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -112,7 +112,7 @@ Using \-\-rsync\-options it is possible to manually select which options to use.
.P
\-a, \-l, \-p, \-t, \-g, \-o, \-c, \-h, \-D, \-H, \-X, \-s
.P
Options \-r and \-v are used in any case. Not that options must be specified without dash (\-), for example:
Options \-r, \-v, \-\-ignore\-missing\-args and \-\-mkpath are used in any case. Note that options must be specified without dash (\-), for example:
.P
.EX
simple_backup \-\-rsync\-options a l p
+5 -5
View File
@@ -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}')