View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Gualtiero Chiaia > App-BackupPlan > App::BackupPlan



Annotate this POD

View/Report Bugs
Module Version: 0.0.7   Source  


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


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


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.


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.

                <plan name="one">
                        <task name="pics">
                        <task name="video">


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,, which can be easily scheduled as cron task and, that can be run as follow: -c /pathto/plan.xml -l /pathto/log4perl.conf when using system tar, or as -c /pathto/plan.xml -l /pathto/log4perl.conf -t perl for perl tar.


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

On some distributions XML::DOM does not build straight away, using cpan install or download & make. This is caused by a dependency of this module, XML::Parser, requiring a C library to be present in your system: expat-devel. On some distributions, Debian for example, this package is unavailble. This problem can be overcome by first installing (apt-get) libxml-parser-perl.


None by default.


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


Gualtiero Chiaia


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: