From a0992fc0e4ae1b7d95090d1220326a2085d7b273 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Thu, 13 Oct 2022 21:30:12 -0700 Subject: [PATCH] Fix issues with 0 sized info files for raw backup 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 --- btrbk | 1 + 1 file changed, 1 insertion(+) diff --git a/btrbk b/btrbk index 809c314..0b5a63f 100755 --- a/btrbk +++ b/btrbk @@ -2005,6 +2005,7 @@ sub system_read_raw_info_dir($) cmd => [ 'find', { unsafe => $droot->{PATH} }, '-maxdepth', '1', '-type', 'f', + '! -size', 0, '-name', '\*.btrfs.\*info', # match ".btrfs[.gz|bz2|xz][.gpg].info" '-exec', 'echo INFO_FILE=\{\} \;', '-exec', 'cat \{\} \;'