LinkAhead Backups#
Single Backup#
Create a backup of LinkAhead via
linkahead -p path/to/profile.yml backup -d path/to/backup/directory
in order to save the SQL dump of your data (the *.dump.sql file) and a backup of LinkAhead’s
internal file system (the *.tar.gz).
Regular Backups#
Of course, it is recommended to do regular backups. One way to do this is to use cronjob. This can be nicely combined with rsnapshot to prevent the backups from growing too much. With rsnapshot, rotating backups can be created that are kept for predefined intervals. To combine this with LinkAhead backups, do the following.
Create a specific LinkAhead backup script that will be executed by rsnapshot and that stores the backups in its current working directory. For example, create a
/usr/local/bin/backup_linkahead_rsnapshot.shwhich contains the following lines (may have to be adapted to your LinkAhead installation, see above).#!/bin/sh linkahead backup -d ./
Adjust the rsnapshot configuration in
/etc/rsnapshot.conf(see its documentation):Create reasonable intervals that correspond to the frequency with which backups are rotated, e.g.,
daily,weekly, andmonthlyof which 14, 8, and 12 copies are kept, respectively. I.e., you’ll be keeping daily backups for two weeks, weekly for the following two months, and monthly for a year.Choose a meaningful
snapshot_rootin which the backups will be stored.Add the script created above to the backup scripts in
/etc/rsnapshot.conf. In the above example, the line looks likebackup_script /usr/local/bin/backup_linkahead_rsnapshot.sh linkahead/
Possibly remove standard backup directories like
/etc/and/home/from the/etc/rsnapshot.conf
Test the config with
rsnapshot configtestfor correctness.Make a test run. For example
rsnapshot -t dailyorrsnapshot daily. The former performs a dry run, the latter actually creates a backup.Add the rsnapshot commands to execute the backup intervals defined above to your crontab. In the above example,
dailycould be executed each day at 2 am,weeklyon every Sunday at 1:30, andmonthlyon each first day of the month at 1 am with the following lines.0 2 * * * /usr/bin/rsnapshot daily 30 1 * * 1 /usr/bin/rsnapshot weekly 0 1 1 * * /usr/bin/rsnapshot monthly
Check (after some time) logs in
/var/log/syslog(default log location)