From 52c19bb8fa87a72c03cb0f4737f4c7e7386ca323 Mon Sep 17 00:00:00 2001 From: "Felix Wischke (65278)" Date: Wed, 27 Apr 2022 12:43:39 +0200 Subject: [PATCH] lib/PostgresTools/Archive.pm: deprecate File/Rsync.pm We're only using this module as a fancy spawner. Cutting it removes a dependency to IPC::Run3, which makes the tools more upgrade resilient --- lib/PostgresTools/Archive.pm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/PostgresTools/Archive.pm b/lib/PostgresTools/Archive.pm index a8638a6..a9bbf63 100644 --- a/lib/PostgresTools/Archive.pm +++ b/lib/PostgresTools/Archive.pm @@ -6,7 +6,6 @@ use 5.012; use Moo; use File::Path; -use File::Rsync; use PostgresTools::Date; has keep_days => ( is => 'rw' ); @@ -22,9 +21,9 @@ sub BUILD { sub backup { my $self = shift; - my $rsync = File::Rsync->new( { archive => 1 } ); - $rsync->exec( { src => $self->{base_dir}, dest => $self->{dst} } ) or die $!; + system("rsync --archive $self->{base_dir} $self->{dst}") == 0 + or die "$?, $!"; } sub clean { @@ -45,9 +44,8 @@ sub clean { rmtree $to_clean or warn $!; } - my $rsync = File::Rsync->new( { archive => 1, delete => 1 } ); - - $rsync->exec( { src => $self->{base_dir}, dest => $self->{dst} } ) or die $!; + system("rsync --archive --delete $self->{base_dir} $self->{dst}") == 0 + or die "$?, $!"; } 1;