alpine-backup Tutorial
A quick reference to the backup system
July 2012
Setup
Once you have installed alpine-backup, you should take a look at the example configuration file. Each file describes one server. To add volumes simply create a new section. The format is that of a standard INI file. In order to be useful, each section must have at least source and dest sections. Most options are configurable in these files.
There are also some global options at the top of the alpine-backup
file. These are: date format, default options, include path and the path to the configuration file. rsync
is assumed to be in your path. You may need to change the shebang line at the top to the right path for php5
.
After configuring, try the backup manually before adding it to your crontab. You will setup mount points first. You may see errors about 'current' or 'deleting old backups'; these are normal and will probably only occur the first time. When you are using cron, you can view the logs by running mail
on your system.
The syntax: alpine-backup <server> <item>
Or to backup all the items on a server: alpine-backup <server>
Configuration File Format
Name | Description |
---|---|
source | Specifies the source of the backup. This may be local or remote. |
dest | Specifies the destination of the backup. This may be local or remote. |
opt | Sets custom options to be passed to rsync . Specific to this volume. |
mount | Causes mounting of specified volumes. More on this later. |
delete_after | Causes old backups to be deleted after the specified time. (e.g. '30 days') |
Mount Driver Setup
Mount drivers allow alpine-backup to mount filesystems, dump databases and perform other preparation activities for a backup.
Format: mount = "cifs","joe@foobar:/test/files","/mnt/mymountpoint"
A mount option is composed of three parts separated by commas. The first part is the file system type. The second is the source in user@server:VOLUME
format. The third is the local mount point. Your mount point must also be set as the source.
NOTE: You should modify your mount driver (usually located in /usr/lib/alpine-backup
) to ensure correct settings (trees, contexts, passwords, etc.) are correctly set.
More info about mount drivers >>>
No-change Syncing
After running a backup for a while, you will probably want to sync it from server to server, in case of a crash, alpine-backup makes this very simple; all you do is provide the slave server with a copy of the configuration files and then run alpine-backup like this:
syncalp <server> <item> <master>
(If you wish to backup all the items on a server, you can use all
as the item.)
Reporting Tools and other Utilities
alpine-backup 0.62 adds 2 new utilities for reporting the statuses of backups and configuration files:
alp-getdata
: Connects to specified backup servers and gets the results of backups on those serversalp-report
: Displays the results ofalp-getdata
and dumps of configuration files
Of course, some useful utilities from 0.61 are still here:
alp-dbrestore
: Restores backups of MySQL databases to a restore DB of your choicealp-sync.sh
: Syncs configuration files between backup serverssummary-gen.sh
: A simple script that adds a summary of backup messages (and statistics; new in 0.62) to the end of mail messages
What's new
- Better delete algorithm
- No-change syncing
- Reporting tools
- Multi-item backups