Get Manvis at SourceForge.net. Fast, secure and Free Open Source software downloads Manvis project hosted at SourceForge.net

BackupPC Recurring Backups

At manvis.sourceforge.net we are enthusiastic BackupPC users. We greatly appreciate its clever pooling scheme and its powerful yet simple web interface, though we feel the lack for a true scheduler.

If your needs are limited to workstation backups you may be satisfied with its normal behaviour, but if you need to back a server up you certainly want it backed up at night or some other hour of the day and you want a full backup to occur on a precise week day, while you want incremental backups to occur on the other week days. More, you may want to back a server up more than one time a day.

This unofficial patch implements a simple yet effective scheduler for BackupPC.

This patch adds the ability to schedule your backups at a precise hour of the day and in precise days of the week, while retaining the normal BackupPC's behaviour. You may activate the scheduler for one or more servers, while your workstations are handled as usual, or your may activate it globally thus forcing every host defined in your backup server to follow your new schedule plan.

INSTALLATION

Download the patch.

Change your current directory to the one where you unpacked the BackupPC tarball. You need BackupPC source for this. For example:

cd /path/to/BackupPC-3.2.0
		

Apply the patch. For example:

patch -b -p0 -i /path/to/RecurringBackups-3.2.0-v2.patch
		

Install or upgrade BackupPC. For example:

perl configure.pl
		

Don't worry, existing hosts will not be affected and your BackupPC server will operate as usual until you configure the new parameters.

Upgrading an existing BackupPC installation may be tricky in that the new web configuration parameters may not be immediately visible. If "DailyBackups" do not appear in the "Schedule" web page, restart the backuppc daemon and restart your web browser.

CONFIGURATION

You may use the web interface or you may use your preferred text editor. This patch follows the usual configuration scheme which implies a global configuration file (/etc/BackupPC/config.pl) which may be overriden by per host configuration files (/etc/BackupPC/pc/<host>.pl).

We will show you how to configure BackupPC using a text editor, but you may feel more comfortable with it if you use the web configurator. You may find the new configuration parameter "DailyBackups" in the "Schedule" web page under the "Recurring Backups" section.

The concepts behind our scheduler are simple. You define a WakeupSchedule plan which covers all relevant hours of the day. Our WakeupSchedule looks like the following:

$Conf{WakeupSchedule} = [ 8, 0, 1, 2 ,3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23 ];
		

Please note that the nightly job runs at 08:00 in this example. Decimals are allowed.

Then, you define one or more time windows describing when you want your job started. Note that your job may not start if other jobs are running and if no more jobs are allowed to run concurrently. You may increase the concurrent jobs number or you may widen the time window and allow for your job to start later, when the jobs number lowers.

You must define:

  • The day(s) of the week (0=sunday,1=monday, ... ,6=saturday,7=sunday).
  • The window start hour of the day (0=midnight, ... ,23)(decimals are allowed).
  • The window duration in hours (decimals are allowed).
  • Whether you want a full (doFull=1) or an incremental (doFull=0) backup.

A simple example follows.

$Conf{DailyBackups} = [
  {
    'weekDays' => [ 6 ],
    'hourDuration' => 6,
    'doFull' => 1,
    'hourBegin' => 23
  },
  {
    'weekDays' => [ 0, 1, 2, 3, 4, 5 ],
    'hourDuration' => 6,
    'doFull' => 0,
    'hourBegin' => 23
  }
];
		

Example explanation.

On saturdays ('weekDays' => [ 6 ]) a job will start at or after 23:00 ('hourBegin' => 23) and not after 05:00 on next day ('hourDuration' => 6), it will do a full backup ('doFull' => 1). From sunday to friday ('weekDays' => [ 0, 1, 2, 3, 4, 5 ]) a job will start at or after 23:00 ('hourBegin' => 23) and not after 05:00 on next day ('hourDuration' => 6), it will do an incremental backup ('doFull' => 0).

More complex schedule plans may be implemented, for example, a second backup job may be run at 12:00 for critical data archiving.

WARNINGS

The first time a job runs it does a full backup, whatever value you choose for doFull.

If a defined time window comes to an end and your job has not yet run, that job is missed and it will only be retried when a new time window opens.

You may want to disable the legacy job scheduler and prevent additional backup jobs to run beside the ones you defined. You need to increase the time periods between full and incremental backups, for example:

$Conf{FullPeriod} = 99;
$Conf{IncrPeriod} = 99;
		

and you need to disable all blackout periods, for example:

$Conf{BlackoutPeriods} = [];
		

If you back your servers up with the new scheduler and concurrently you back your workstations up with the legacy scheduler, we suggest that you insert the previous statements in your "per host" configuration files.

A proper DST time handling is recommended. Two times a year your sistem clock will shift. When you enter DST, you system clock shifts forwards and you incur the risk to miss your backup jobs. When you exit DST, your system clock shifts backwards and you incur the risk to run some jobs twice. We suggest you do not start your job time window inside your DST window, for example, CEST (DST for CET) starts at 02:00 and your system clock suddenly shifts to 03:00, so it is not recommended that your time window opens at 02:00. CEST ends at 03:00 and your system clock suddenly shifts to 02:00, again, it is not recommended that your time window opens at 02:00. Defining a time window of 2 hours or more will lessen DST related problems. Please note that short living jobs (less than an hour) may be executed twice anyway and that this is not a critical event. On the contrary, missing some jobs may be considered a critical event and should be avoided.