| 1 | package MMM::Sync::Ftp; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 3 | our @ISA = qw(MMM::Sync); | |||||||||
| 6 | |||||||||||
| 7 | 0 | ▶ | sub buildcmd { | ||||||||
|
Subroutine
buildcmd: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||
| 8 | 0 | my ($self) = @_; | |||||||||
| 9 | |||||||||||
| 10 | 0 | my @command = ('mirrordir', '--no-chown'); | |||||||||
| 11 | |||||||||||
| 12 | 0 | ▶ | if ($self->{options}{ftp_defaults}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 0 | push(@command, split(/ +/, $self->{ftp_defaults})); | |||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | 0 | ▶ | if ($self->{options}{exclude}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 0 | foreach ( map { split( m/ /, $_ ) } $self->{options}{exclude} ) { | |||||||||
| 18 | 0 | push( @command, '--exclude-glob', $_ ); | |||||||||
| 19 | } | ||||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | if (!grep { $self->{options}{$_} } (qw(delete-after delete delete-excluded))) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 0 | push(@command, '--keep-files'); | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 0 | ▶ | if ($self->{options}{tempdir}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 0 | $ENV{TMPDIR} = $self->{options}{tempdir}; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | push( @command, | ||||||||||
| 31 | $self->{source}, | ||||||||||
| 32 | $self->{dest} | ||||||||||
| 33 | 0 | ); | |||||||||
| 34 | |||||||||||
| 35 | 0 | ▶ | if ($self->{options}{password}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | 0 | push(@command, '--password', $self->{options}{password}); | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 0 | return @command; | |||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 3 | 1; | |||||||||