A system for implementing backups in complex environments

TTP 2011

alpine-backup is a simple backup system that can be used to implement a wide variety of backup scenarios. Incremental backups are implemented using rsync’s link destination feature, allowing full backups to be accessed while only storing changes. Synchronization between backup servers can be implemented with no additional configuration. The program uses drivers to mount, backup and dump many different systems. A status report and failure alert system is built-in. Additional tools are provided, including a script to backup devices with unreliable internet connections and uptime.

Design and Implementation

alpine-backup is a lightweight, rsync-based incremental backup system, written in PHP. It is designed primarily for backup up servers over the network. Many applications and protocols are supported, including: NWFS, CIFS, MySQL, SQLite, and GroupWise post offices. For more drivers, see the complete list.

SQL databases can be backed up by doing a live dump, one table per file. Thus, space savings can be realized if some tables don’t change.

Ensuring reliable backups is the primary concern for the design of this tool. The result of all transfers and operations is verified and no changes are made to pointers or data unless the backup was successful. Old backups are purged using a robust algorithm that ensures that backups are kept for the chosen number of days, even if filesystem timestamps vary. The system has integrated reporting tools which can aggregate status reports from many backup servers in an organization and automatically send alerts in case of failure.

For backing up devices with unreliable network connections (e.g. my laptop in rural BC or on McGill’s wireless network), a tool is included that automatically restarts backups in progress whenever the device regains an internet connection.

The primary advantage of alpine-backup is that all of these features are implemented with a few very easy to understand scripts, making it easy to understand how the process works, how to add new features and how to correct problems.


Installation and Usage

  • Check out the git repository. The program requires php and rsync to be installed on the system. To install the program, run ./install (see INSTALL for options).
  • Backup configurations are formatted as INI files. Within a configuration file for a server, each section represents a backup item (e.g. volume, service, directory, etc.)
  • To perform a backup: alp server volume
  • To synchronize a backup from another server: syncalp server volume source-server