Changeset 36 for trunk


Ignore:
Timestamp:
11/08/05 19:40:43 (19 years ago)
Author:
thauvin
Message:
  • add documentation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/soft/scripts/transfert

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r35 r36  
    22 
    33# $Id$ 
     4 
     5=head1 NAME 
     6 
     7transfert - A script to transfert data using rsync 
     8 
     9=head1 VERSION 
     10 
     11CVS: $Revision$ 
     12 
     13=cut 
    414 
    515use strict; 
     
    919use Mail::Sendmail; 
    1020use POSIX qw(strftime); 
     21use Pod::Usage; 
    1122 
    1223# 0 .. 6 => debug, info, report, warn, error, die 
     
    1425 
    1526GetOptions( 
    16     'config|s=s' => \my $configfile, 
     27    'config|c=s' => \my $configfile, 
    1728    'v' => sub { $verbose-- }, 
    1829    'd|debug' => \my $debug, 
     
    2031    'mailto' => \my $mailto, 
    2132    'logfile=s' => \my $logfile, 
    22 ); 
     33    'help|h' => sub { pod2usage(-exitval => 0) }, 
     34) or pod2usage(); 
     35 
     36=head1 SYNOPSIS 
     37 
     38transfert -c <configfile> [...] 
     39 
     40    config|c <configfile>   use this config file 
     41    v                       increase verbosity 
     42    nomail                  do not sent any mail 
     43    logfile <logfilefmt>    write log into this file 
     44    help|h                  print this message 
     45    debug|d                 debug mode 
     46 
     47=head1 OPTIONS 
     48 
     49=head1 CONFIGURATION FILE 
     50 
     51=head2 Description 
     52 
     53The configuration is an INI file like. Each section describe 
     54a path to transfert. The section named 'default' is used to store 
     55global or default values. 
     56 
     57Example: 
     58 
     59    [default] 
     60 
     61    [musique] 
     62    source=/source/ 
     63    dest=host:/dest 
     64    mailto=user@domain 
     65 
     66=head2 Globals values 
     67 
     68Following paramater should be set into [default] section: 
     69 
     70=over 
     71 
     72=item * smtp Mail host to use to send mail, default is 'localhost' 
     73 
     74=item * mailfrom the mail adress set into mail as from, only the form 
     75user@domain should appear 
     76 
     77=item * mailheader a message to copy at the beggining of each mail 
     78 
     79=item * mailfooter a message to copy at the end of each mail 
     80 
     81=item * logfile redirect log into this file. 
     82 
     83logfile is a strftime format. See L<strftime> man page, or L<POSIX> 
     84perl module documentation. 
     85 
     86=head2 Per transfert parameters 
     87 
     88All this paramter can be set into [default] section 
     89 
     90=item * source the source file to transfert.  
     91 
     92This paramater is passed directly to rsync, so can be a glob. 
     93 
     94=item * destination the destination where file should be copied 
     95 
     96=item * rsync command location, default is 'rsync' 
     97 
     98=item * mailto the list of coma separate mail address which will receive  
     99transfert log 
     100 
     101=back 
     102     
     103=cut 
    23104 
    24105$verbose = 0 if ($debug); 
     
    137218            'X-OSBDATA-HOST' => "", 
    138219            Smtp => $config->val('default', 'smtp', 'localhost'), 
    139             From => 'Data transfert bot ' . $config->val( 
     220            From => 'Data transfert bot <' . $config->val( 
    140221                'default',  
    141222                'mailfrom', 
    142                 '<olivier.thauvin@aerov.jussieu.fr>'), 
     223                'olivier.thauvin@aerov.jussieu.fr') .'>', 
    143224 
    144225        ); 
     
    154235__END__ 
    155236 
     237=head1 AUTHOR 
     238 
     239Olivier Thauvin <olivier.thauvin@aerov.jussieu.fr> 
     240 
    156241=head1 CHANGELOG 
    157242 
    158243    $Log$ 
     244    Revision 1.3  2005/11/08 18:40:43  thauvin 
     245    - add documentation 
     246 
    159247    Revision 1.2  2005/11/08 17:17:29  thauvin 
    160248    - add logfile support 
Note: See TracChangeset for help on using the changeset viewer.