The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::DistSync - Utility synchronization of the mirror distribution-sites

VERSION

Version 1.04

SYNOPSIS

    use App::DistSync;
    
    my $ds = new App::DistSync(
            dir => "/var/www/www.example.com/dist",
            pid => $$,
        );

    $ds->init or die ("Initialization error");
    
    $ds->sync or die ("Sync error");

DESCRIPTION

Utility synchronization of the mirror distribution-sites

METHODS

new
    my $ds = new App::DistSync(
            dir => "/var/www/www.example.com/dist",
            pid => $$,
        );

Returns the object

init
    $ds->init or die ("Initialization error");

Initializing the mirror in the specified directory

sync
    $ds->sync or die ("Sync error");

Synchronization of the specified directory with the remote resources (mirrors)

SHARED FUNCTIONS

fdelete
    my $status = fdelete( $file );

Deleting a file if it exists

fetch
    my $struct = fetch( $URI_STRING, "path/to/file.txt", "/tmp/file.txt" );
    

Fetching file from remote resource by URI and filename. The result will be written to the specified file. For example: "/tmp/file.txt"

Function returns structure, contains:

    {
        status  => 1,         # Status. 0 - Errors; 1 - OK
        mtime   => 123456789, # Last-Modified in ctime format or 0 in case of errors
        size    => 123,       # Content-length
        code    => 200,       # HTTP Status code
    };
touch
    my $status = touch( $file );

Makes files exist, with current timestamp. See original in "touch" in ExtUtils::Command

HISTORY

See CHANGES file

DEPENDENCIES

LWP

TO DO

See TODO file

BUGS

* none noted

SEE ALSO

perl, LWP, ExtUtils::Manifest

AUTHOR

Serz Minus (Lepenkov Sergey) http://www.serzik.com <minus@mail333.com>

COPYRIGHT

Copyright (C) 1998-2014 D&D Corporation. All Rights Reserved

LICENSE

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See LICENSE file