- Timestamp:
- 11/08/05 19:40:43 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/soft/scripts/transfert
- Property cvs2svn:cvs-rev changed from 1.2 to 1.3
r35 r36 2 2 3 3 # $Id$ 4 5 =head1 NAME 6 7 transfert - A script to transfert data using rsync 8 9 =head1 VERSION 10 11 CVS: $Revision$ 12 13 =cut 4 14 5 15 use strict; … … 9 19 use Mail::Sendmail; 10 20 use POSIX qw(strftime); 21 use Pod::Usage; 11 22 12 23 # 0 .. 6 => debug, info, report, warn, error, die … … 14 25 15 26 GetOptions( 16 'config| s=s' => \my $configfile,27 'config|c=s' => \my $configfile, 17 28 'v' => sub { $verbose-- }, 18 29 'd|debug' => \my $debug, … … 20 31 'mailto' => \my $mailto, 21 32 'logfile=s' => \my $logfile, 22 ); 33 'help|h' => sub { pod2usage(-exitval => 0) }, 34 ) or pod2usage(); 35 36 =head1 SYNOPSIS 37 38 transfert -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 53 The configuration is an INI file like. Each section describe 54 a path to transfert. The section named 'default' is used to store 55 global or default values. 56 57 Example: 58 59 [default] 60 61 [musique] 62 source=/source/ 63 dest=host:/dest 64 mailto=user@domain 65 66 =head2 Globals values 67 68 Following 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 75 user@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 83 logfile is a strftime format. See L<strftime> man page, or L<POSIX> 84 perl module documentation. 85 86 =head2 Per transfert parameters 87 88 All this paramter can be set into [default] section 89 90 =item * source the source file to transfert. 91 92 This 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 99 transfert log 100 101 =back 102 103 =cut 23 104 24 105 $verbose = 0 if ($debug); … … 137 218 'X-OSBDATA-HOST' => "", 138 219 Smtp => $config->val('default', 'smtp', 'localhost'), 139 From => 'Data transfert bot ' . $config->val(220 From => 'Data transfert bot <' . $config->val( 140 221 'default', 141 222 'mailfrom', 142 ' <olivier.thauvin@aerov.jussieu.fr>'),223 'olivier.thauvin@aerov.jussieu.fr') .'>', 143 224 144 225 ); … … 154 235 __END__ 155 236 237 =head1 AUTHOR 238 239 Olivier Thauvin <olivier.thauvin@aerov.jussieu.fr> 240 156 241 =head1 CHANGELOG 157 242 158 243 $Log$ 244 Revision 1.3 2005/11/08 18:40:43 thauvin 245 - add documentation 246 159 247 Revision 1.2 2005/11/08 17:17:29 thauvin 160 248 - add logfile support
Note: See TracChangeset
for help on using the changeset viewer.