From 4e5ae975d87aaf193ffac76a1a6801b74101b22a Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Thu, 13 Oct 2022 21:30:12 -0700 Subject: [PATCH] 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 --- btrbk | 1 + 1 file changed, 1 insertion(+) diff --git a/btrbk b/btrbk index daa52eb..c92eece 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 \{\} \;'