FTPMIRROR

Introduction

Ftpmirror is an utility to copy directory hierarchy (this is called ``mirror'') with FTP. A transfer is triggered only when modified, it can be efficient transferring directory trees.

It is userful for ftp-servers maintenance, contentns sync with web server, system backupping and so on.

A similar perl script exists, whose name is `mirror', this implementation is fully comparing directory lists of sources and distination, it take a heavy memmory load. If use on a large directory trees, so eat a lot of memory(or swap) spaces. When I use ftp-server with 16MB memory, 'mirror' software is not usable :-p, so I wrote software from scratch, that is frpmirror. For example, full mirroring of FreeBSD distribution (ftp://ftp.FreeBSD.ORG/pub/FreeBSD/*) needs 8~9 MB. *(Notice by translator) Original document wrote at old(1998). May be this results has obsolete.*

You need perl-5.003 or later to use ftpmirror. Please ensure that perl-5.003 or later was installed in your environment, at first. But, perl 5.004 has a bug of memory leak. It eat a lot of memory spaces when mirroring directory tree. I test with perl5.005, it has small memory leak too, it is smaller than perl 5.004, it is not critical for real usage. I suggest you using Perl 5.005.

How to use ftpmirror

  1. Install ftpmirror first. The newest version of ftpmirror is available from ftp.intec.co.jp.

    Please use these URLs.

    Since ftpmirror is a archive of instal files, you must only extract the archive. Do one of following:

      % cd /usr/local/src
    % gzip -cd < /tmp/ftpmirror-x.y.tar.gz | tar xf -
    
    
    So create a directory named ftpmirror-x.y. Change directory and execute configure:
    Notice: If you need define specific perl verions, please set perls path for enviroment variable "PERL".
    % cd ftpmirror-x.y
    % ./configure 
    
    Or, when you need specific perl version:
    % cd ftpmirror-x.y
    % env PERL=/usr/local/bin/perl5.005 ./configure 
    
    Execute make:
    % make
    
    When finished make with no errors. So install:
    % su
    # make install
    
    In finished this procedure, so installed files are below paths:
    /usr/local/bin/ftpmirror
    /usr/local/bin/rotate
    /usr/local/etc/ftpmirror.cf-sample
    /usr/local/lib/perl5/site_perl/Fan.pm
    /usr/local/lib/perl5/site_perl/Fan/...   (and some dirs)
    /usr/local/lib/perl5/site_perl/auto/Fan/...  (and some dirs) 
    
    * Notice: libraries install directory can changes 
        with perl's installed settings.
    
    And copying and editing a configuration files, please add difinition what you needs.
    # cd /usr/local/etc
    # cp ftpmirror.cf-sample ftpmirror.cf
    # vi ftpmirror.cf
    
    

    Configuration

    You can define parameters for ftpmirror with the default configuration file, package specific configuration file, and run-time options (commands arguments). In addition, configuration files are set /usr/local/etc/ftpmirror.cf by defauls, it can change by command argument "--load-config=/hoge/local.cf" if you need. And argument "--load-config=+/hogehoge/local.cf" is used, this is append reading after adove defaults reading.

    Configuration parameters have follwoing types.

    Default parametes:
    Configuration files settings. They are written before
    Serverss and Packages parameters. 
    
    Server parameters:
    Difinition of server specific(timeouts, gateways and
    so on..). They are provided at configuration files, 
    with 'server' parameters.
    
    Package parameters:
    Difinition of packages specific(direcotry, transfer 
    modes and so on). They are provided at configuration files, 
    with 'package' parameters.
    
    Option parameters:
    It provide by command args.
    
    Their parameters are settings by adove order(when exists). Option parameters are most prefferd.

    How to settings parameters at configuration files:
    That has two syntaxr,

    param-name = value
    or 
    param-name += value 
    
    =  is set param-name by value.
    += is adding value(strings) for param-name.
    

    How to settings parameters at commands args:
    When using by commands args,any parameters must be prepended by "--" in command line options. That use --(two minus) before options. For example, following syntax is same as adove configuration settings.

    % ftpmirror --param-name=value ...
    % ftpmirror --param-name+=value ...
    

    Parameters

    There are many acceptable parameters as follows: