The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

VERSION

Version 1.06

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

PRIVATE FUNCTIONS

debug

show debug information

manifind, maniread, maniwrite

Working with manifest file

read_yaml, write_yaml

Working with YAML files

HISTORY

See Changes file

DEPENDENCIES

CTK

TO DO

See TODO file

BUGS

* none noted

SEE ALSO

CTK

AUTHOR

Serż Minus (Sergey Lepenkov) http://www.serzik.com <abalama@cpan.org>

COPYRIGHT

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

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See LICENSE file and https://dev.perl.org/licenses/