diff --git a/btrbk b/btrbk index 307d74f..6225c7e 100755 --- a/btrbk +++ b/btrbk @@ -65,6 +65,7 @@ my $ipv6_addr_match = qr/[a-fA-F0-9]*:[a-fA-F0-9]*:[a-fA-F0-9:]+/; # simplified my $host_name_match = qr/(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])/; my $uuid_match = qr/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/; my $btrbk_file_match = qr/(?.+)\.(?[0-9]{4})(?[0-9]{2})(?
[0-9]{2})(T(?[0-9]{2})(?[0-9]{2})((?[0-9]{2})(?(Z|[+-][0-9]{4})))?)?(_(?[0-9]+))?/; # matches "NAME.YYYYMMDD[Thhmm[ss+0000]][_NN]" +my $timeshift_file_match = qr/(?[0-9]{4})-(?[0-9]{2})-(?
[0-9]{2})_(?[0-9]{2})-(?[0-9]{2})-(?[0-9]{2})\/(?[^\/]+)/; # matches "YYYY-MM-DD_hh-mm-ss/NAME" my $raw_postfix_match = qr/\.btrfs(\.($compress_format_alt))?(\.(gpg|encrypted))?/; # matches ".btrfs[.gz|.bz2|.xz|...][.gpg|.encrypted]" my $safe_file_match = qr/[0-9a-zA-Z_@\+\-\.\/]+/; # note: ubuntu uses '@' in the subvolume layout: @@ -2839,6 +2840,9 @@ sub add_btrbk_filename_info($;$) if($rel_path =~ /^(?:(?.*)\/)?$btrbk_file_match$/) { %match = ( %+, family => "btrbk" ); } + elsif($rel_path =~ /^(?:(?.*)\/)?$timeshift_file_match$/) { + %match = ( %+, family => "timeshift" ); + } }; return undef unless $match{name}; my $btrbk_date = _get_btrbk_date(%match); # use named capture buffers of previous match @@ -3758,7 +3762,7 @@ sub get_best_parent($$;@) next if(grep { $_->[0]{node}{id} == $cc->[0]{node}{id} } @parent); DEBUG "Resolved " . (@parent ? "clone source" : "parent") . " (" . "next closest " . ($k =~ /n/ ? "newer" : "older") . - " by " . ($k =~ /s/ ? "btrbk timestamp in snapdir" : "cgen") . + " by " . ($k =~ /s/ ? "timestamp in snapdir" : "cgen") . ", " . ($k =~ /r/ ? "with" : "regardless of") . " parent_uuid relationship" . "): $cc->[0]{PRINT}" if($loglevel >= 3); push @parent, $cc;