MMM::Rsync.3pm

Langue: en

Version: 2006-11-09 (mandriva - 01/05/08)

Section: 3 (Bibliothèques de fonctions)

NAME

MMM::Rsync

SYNOPSIS

DESCRIPTION

An object to manage the rsync process and mirror choice.

METHODS


new( $source, %options)


new( $source, %options)

Create a new MMM::Rsync object

$source is the mirror source name

%options should provide:

statedir: the directory where status ini file are located log: a code ref to handle message

log( $level, $fmt, @args)


log( $level, $fmt, @args)

This function is used to handle messages

dest

Return the destination directory of this process

source

Return the mirror source handle by the object

level

Return the level this queue should achieve

frequency

Return the frequency value from config

estimate_frequency

Return the estimate frequency after taking into account all delaying configuration value

val( $var, $default)


val( $var, $default)

Return the configuration value for $var. Return $default if parameter is not set in the config

mirrorlist

Return a ref to the MirrorQueue mirror collection used by this rsync queue

set_mirror_list( $mirrorlist)


set_mirror_list( $mirrorlist)

Set the MirrorQueue mirrir collection used by this rsync queue

is_disable

Return true if the queue is disable

need_run

Return true if the queue have to run according schedule time

is_running

Return true if the is already running

next_run_time

Return the next time estimate process time

last_duration

Return duration last processing need

average_duration

Return the average of last time need to proccess this rsync

last_start

Return last time this rsync was started

lastrun_info

Return a hash with info about last process

lastsuccess_info

Return a hash with info about last process which successed

running_info

Retrun a hash with info about current running process if any

choose_my_level

Find best level this mirror can expect by looking availlable mirrors in the list

reset_mirror_list

Reset internal mirror list to start a new schedule

get_next_mirror

fetch the next mirror from the mirrors queue list and set it as the current mirror to use

should_use_other_mirrors

Return true if others mirror than the first in the queue should be used to success the process if first failed

build_rsync_cmd

Return an array with all rsync arg to exec

exec_rsync

Launch rsync process, return 0 on success, 1 if any error, 2 if the mirror cannot be used, 3 on uncoverable error

lock

Lock this queue job

lock

Unlock this queue job

validate_mirror

Return true if the mirror can be use according its know info and queue status

SEE ALSO

MMM MMM::MirrorQueue

AUTHOR

Olivier Thauvin <nanardon@nanardon.zarb.org> Copyright (C) 2006 Olivier Thauvin

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 2 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.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.