Last change
on this file since 78 was
78,
checked in by nanardon, 15 years ago
|
|
-
Property svn:executable set to
*
-
Property svn:keywords set to
Id Rev
|
File size:
1.0 KB
|
Line | |
---|
1 | #!/usr/bin/perl |
---|
2 | |
---|
3 | use strict; |
---|
4 | use warnings; |
---|
5 | use LATMOS::Accounts; |
---|
6 | use LATMOS::Accounts::Synchro; |
---|
7 | use Getopt::Long; |
---|
8 | use Pod::Usage; |
---|
9 | |
---|
10 | =head1 NAME |
---|
11 | |
---|
12 | la-sync - Tools to synchronize base |
---|
13 | |
---|
14 | =head1 SYNOPSIS |
---|
15 | |
---|
16 | Show configured bases: |
---|
17 | |
---|
18 | la-sync [sync name] [options] |
---|
19 | |
---|
20 | =cut |
---|
21 | |
---|
22 | GetOptions( |
---|
23 | 'c|config=s' => \my $config, |
---|
24 | 'help' => sub { pod2usage(0) }, |
---|
25 | 'from=s' => \my $from, |
---|
26 | 'to=s' => \my @to, |
---|
27 | 'nocreate' => \my $nocreate, |
---|
28 | 'test' => \my $test, |
---|
29 | ) or pod2usage(); |
---|
30 | |
---|
31 | =head1 OPTIONS |
---|
32 | |
---|
33 | =item -c|--config configfile |
---|
34 | |
---|
35 | Use this configuration file instead default |
---|
36 | |
---|
37 | =item --from basename |
---|
38 | |
---|
39 | Specify souce base to use |
---|
40 | |
---|
41 | =item --to basename |
---|
42 | |
---|
43 | Specify destination base to use, this option can be used |
---|
44 | severals times |
---|
45 | |
---|
46 | =cut |
---|
47 | |
---|
48 | my $LA = LATMOS::Accounts->new($config); |
---|
49 | |
---|
50 | my $sync = $LA->create_synchro( |
---|
51 | $ARGV[0], |
---|
52 | from => $from, |
---|
53 | to => (@to ? [ @to ] : undef), |
---|
54 | nocreate => $nocreate, |
---|
55 | test => $test, |
---|
56 | ) or die "cannot create sync object\n"; |
---|
57 | $sync->load_dest and return; |
---|
58 | $sync->process() or warn "Sync has failed\n"; |
---|
Note: See
TracBrowser
for help on using the repository browser.