Gualtiero Chiaia > App-BackupPlan-0.0.2 > App::BackupPlan

Download:
App-BackupPlan-0.0.2.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.0.2   Source   Latest Release: App-BackupPlan-0.0.7

NAME ^

App::BackupPlan - Perl extension for automated, regular backups

SYNOPSIS ^

  #when using system tar
  use App::BackupPlan;
  my $plan = new App::BackupPlan($configFile, $logFile);
  $plan->run;
  
  #when using perl tar
  use App::BackupPlan;
  $App::BackupPlan::TAR='perl';
  my $plan = new App::BackupPlan($configFile, $logFile);
  $plan->run;  

DESCRIPTION ^

App::BackupPlan is a simple module to perform regular, selective and automated backups of your system. It requires an xml file with the specification of your backup plan, logically divided into independent tasks. The constructor also takes a log4perl configuration file, to customise the logging produced. This can be omitted if the default logging behaviour is desired. By setting up a regular back-up task using cron or similar, and by configuring a backup plan with different tasks, backup frequencies and max number of files retained, it is possible to achieve a regular and incremental backup of different part of your system, without too much trouble.

CONFIGURATION

Here is a made-up sample configuration file for a backup plan that backups two directories with different frequencies: a pictures and a videos directories.

        <backup>
                <plan name="one">
                        <default>
                                <maxFiles>3</maxFiles>
                                <frequency>1m</frequency>
                                <targetDir><![CDATA[/backup]]></targetDir>
                        </default>
                        <task name="pics">
                                <prefix>pics</prefix>
                                <sourceDir><![CDATA[/data/pictures]]></sourceDir>
                                <frequency>20d</frequency>      
                        </task> 
                        <task name="video">
                                <prefix>vid</prefix>
                                <maxFiles>2</maxFiles>
                                <sourceDir><![CDATA[/data/Videos]]></sourceDir>
                                <frequency>40d</frequency>      
                        </task>                 
                </plan>
        </backup>

USAGE

This perl module was written with an automated backup functionality in mind. So, even if it can be run manually and on demand, it is best suited to be integrated in a regular batch (overnight maybe) or even better as a cron task. To facilitate this task there is a script client in the bin directory of this distribution, backup.pl, which can be easily scheduled as cron task and, that can be run as follow: backup.pl -c /pathto/plan.xml -l /pathto/log4perl.conf when using system tar, or as backup.pl -c /pathto/plan.xml -l /pathto/log4perl.conf -t perl for perl tar.

DEPENDENCIES

The list of module dependencies is as follows:

On a Linux system it is recommended to use the system tar executable, which is the default behaviour for this module. There is also the option of using Archive::Tar perl module isntead of the system tar. This is recommended for Windows based systems, or if the tar executable is not available. This behaviour is designated as perl tar and is selected by setting $App::BackupPlan::TAR='perl'.

EXPORT

None by default.

SEE ALSO ^

XML::DOM, Log::Log4perl, File::Find, Archive::Tar

AUTHOR ^

Gualtiero Chiaia

COPYRIGHT AND LICENSE ^

Copyright (C) 2012 by Gualtiero Chiaia

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.3 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: