btrbk: ignore zero-size info files

When backuping from devices that have configured to use raw backup and
that might disconnect from the network (ie. laptops) you end up once in
a while with 0 size info file (and backup file).
btrbk don't know how to handle 0 file and stop backing up until the zero
size file is removed.
With this change 0 size info file will be ignored, and hence the backup
for the given backup will be redone.

Signed-off-by: Matthieu Patou <mat@matws.net>
ionice
Matthieu Patou 2022-10-13 21:30:12 -07:00 committed by Axel Burri
parent f77a33b340
commit 4e5ae975d8
1 changed files with 1 additions and 0 deletions

1
btrbk
View File

@ -2005,6 +2005,7 @@ sub system_read_raw_info_dir($)
cmd => [ 'find', { unsafe => $droot->{PATH} }, cmd => [ 'find', { unsafe => $droot->{PATH} },
'-maxdepth', '1', '-maxdepth', '1',
'-type', 'f', '-type', 'f',
'!', '-size', '0',
'-name', '\*.btrfs.\*info', # match ".btrfs[.gz|bz2|xz][.gpg].info" '-name', '\*.btrfs.\*info', # match ".btrfs[.gz|bz2|xz][.gpg].info"
'-exec', 'echo INFO_FILE=\{\} \;', '-exec', 'echo INFO_FILE=\{\} \;',
'-exec', 'cat \{\} \;' '-exec', 'cat \{\} \;'