App-Shotgun

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

{
   "abstract" : "mass upload of files via SCP/FTP/...",
   "author" : [
      "Torsten Raudssus <torsten@raudssus.de>",
      "Apocalypse <APOCAL@cpan.org>"
   ],
   "dynamic_config" : 0,
   "generated_by" : "Dist::Zilla version 4.200006, CPAN::Meta::Converter version 2.110240",
   "license" : [
      "perl_5"
   ],
   "meta-spec" : {

META.yml  view on Meta::CPAN

---
abstract: 'mass upload of files via SCP/FTP/...'
author:
  - 'Torsten Raudssus <torsten@raudssus.de>'
  - 'Apocalypse <APOCAL@cpan.org>'
build_requires:
  Test::More: 0.96
configure_requires:
  ExtUtils::MakeMaker: 6.30
dynamic_config: 0
generated_by: 'Dist::Zilla version 4.200006, CPAN::Meta::Converter version 2.110240'
license: perl

Makefile.PL  view on Meta::CPAN

use strict;
use warnings;



use ExtUtils::MakeMaker 6.30;



my %WriteMakefileArgs = (
  'ABSTRACT' => 'mass upload of files via SCP/FTP/...',
  'AUTHOR' => 'Torsten Raudssus <torsten@raudssus.de>, Apocalypse <APOCAL@cpan.org>',
  'BUILD_REQUIRES' => {
    'Test::More' => '0.96'
  },
  'CONFIGURE_REQUIRES' => {
    'ExtUtils::MakeMaker' => '6.30'
  },
  'DISTNAME' => 'App-Shotgun',
  'EXE_FILES' => [
    'bin/shotgun'

README  view on Meta::CPAN



This archive contains the distribution App-Shotgun,
version 0.001:

  mass upload of files via SCP/FTP/...

This software is copyright (c) 2011 by Raudssus Social Software L<http://www.raudssus.de/>.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.


bin/shotgun  view on Meta::CPAN

#!/usr/bin/env perl
# PODNAME: shotgun
# ABSTRACT: mass upload of files via SCP/FTP/...

binmode STDOUT, ":utf8";

use App::Shotgun;
App::Shotgun->new_with_options->shot;



=pod

=head1 NAME

shotgun - mass upload of files via SCP/FTP/...

=head1 VERSION

version 0.001

=head1 SYNPOSIS

  shotgun --filelist a_filelist.txt \
	--target FTP:hostname=localhost:username=testftp:password=test
  shotgun --file first_file.txt --file second_file.txt \

lib/App/Shotgun.pm  view on Meta::CPAN

package App::Shotgun;
BEGIN {
  $App::Shotgun::AUTHORITY = 'cpan:GETTY';
}
BEGIN {
  $App::Shotgun::VERSION = '0.001';
}
use strict;
use warnings;

# ABSTRACT: mass upload of files via SCP/FTP/...

use Moose;
use MooseX::Types::Path::Class;
use Cwd qw( getcwd );
use Path::Class::Dir;

with(
	'MooseX::Getopt' => { -version => '0.37' },
	'MooseX::LogDispatch' => { -version => '1.2002' },
);

lib/App/Shotgun.pm  view on Meta::CPAN


# support getting user/pass from a .netrc file ( use Net::Netrc ? )

## log our transfers to a file somewhere
#has transferlog => (
#	isa => 'Str',
#	is => 'ro',
#	predicate => 'has_transferlog',
#);
#
## enable full parallel uploads to ALL targets at the same time
#has parallel => (
#	isa => 'Bool',
#	is => 'ro',
#	default => 0,
#);
#
## get file list from the source, recursively ( ls -lR basically )
#has filerecursive => (
#	isa => 'Bool',
#	is => 'ro',

lib/App/Shotgun.pm  view on Meta::CPAN

no Moose;
__PACKAGE__->meta->make_immutable;
1;


__END__
=pod

=head1 NAME

App::Shotgun - mass upload of files via SCP/FTP/...

=head1 VERSION

version 0.001

=head1 SYNOPSIS

	use App::Shotgun;

	my $shotgun = App::Shotgun->new(

lib/App/Shotgun.pm  view on Meta::CPAN

				path => '/tmp/testenv', # optional
				hostname => 'myother.local',
				username => 'notfor',

				# prepared key authentifications are just working
				# probably more options for configuring ssh, like alternative private key
			},
		],
	);

	# Order of upload:
	# Target 1: robots.txt
	# Target 2: robots.txt
	# Target 1: dir/dir/dir/file.txt
	# Target 2: dir/dir/dir/file.txt
	# ...

	$shotgun->shot;

	print "Success: ".($shotgun->success ? 'YES' : 'NO')."\n";
	print "Error: ".$shotgun->error if (!$shotgun->success);

	my $other_shotgun = App::Shotgun->new(
		source => '/absolute/path',
		filelist => 'filelist.txt',
	);

=head1 DESCRIPTION

This module uploads the filelist textfile given via B<filelist> or the filelist given as array via B<files> to all given B<targets>.
It uploads file after file, to target after target, that means, first file will get uploaded to all target, and if they all are
successful done, the next file will be uploaded. This module doesn't do any "smart" things like compare filesize/modification time/etc and
just uploads the files. Hence the name "shotgun" which is appropriate :)

For first the module is made to try again very often but will not continue on fail and close with an exit code above 0.

Please look at the appropriate C<App::Shotgun::Target::*> classes for their attributes and how to use them.

=head1 METHODS

=head2 shot

The main entry point of this module.



( run in 2.658 seconds using v1.01-cache-2.11-cpan-b16cb0d3907 )