Skip to content

Commit

Permalink
lib/PostgresTools/Archive.pm: deprecate File/Rsync.pm
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Felix Wischke (65278) committed Apr 27, 2022
1 parent f30c8f4 commit 52c19bb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/PostgresTools/Archive.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use 5.012;

use Moo;
use File::Path;
use File::Rsync;
use PostgresTools::Date;

has keep_days => ( is => 'rw' );
Expand All @@ -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 {
Expand All @@ -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;

0 comments on commit 52c19bb

Please sign in to comment.