diff options
author | Carlo Landmeter <clandmeter@alpinelinux.org> | 2018-01-29 15:31:27 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@alpinelinux.org> | 2018-01-29 15:35:06 +0000 |
commit | 05f986658bc04e2dc514b2c3e7777007cb6fb65c (patch) | |
tree | db49882a6aac4ea68b7fa6285c340c09466abcc5 /README.md | |
download | alpine-backup-05f986658bc04e2dc514b2c3e7777007cb6fb65c.tar.bz2 alpine-backup-05f986658bc04e2dc514b2c3e7777007cb6fb65c.tar.xz |
Initial commit
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..caddbbd --- /dev/null +++ b/README.md @@ -0,0 +1,81 @@ +# Alpine Linux Backup + +## Introduction + +Alpine remote backup (RBU) is a set of scripts based on LBU +(Alpine Local Backup). It consist of a main script which need to be run from +cron and a set of profiles which can be used as pre/post scripts for LBU. +The idea of profiles is to simplify the backup process and to make sure +services inside Alpine infrastructure are setup in a similar way. Some of the +features/profiles of RBU are: + +* Dump databases to a cache directory +* Synchronise backups to remote location +* Copy backup status log to remote location +* Send status notifications over mqtt + +## Usage + +### Prerequisite + +* POSIX shell +* LBU (default on Alpine installation) +* rsync `apk add rsync` +* mosquitto-pub `apk add mosquitto-clients` + +### Configuration + +RBU needs a configuration file named `rbu.conf`. This configuration should +(by default) be put in the lbu configuration directory `/etc/lbu`. Inside this +configuration should be a list of exported configuration variables which are +needed for lbu and its pre/post scripts to function properly. + +### Profiles + +Profiles are a setup of LBU pre/post scripts. To use these scripts you should +symlink (or copy) them from the profile directory to one of the following dirs: + +* `pre-package.d` (scripts run before LBU creates its backup) +* `post-package.d` (scripts run after LBU created its backup) + +These profiles/scripts will be run by busybox run-parts which means they cannot +have an extension and need to be executable. If you need to run these scripts +in a specific order you should prefix them with a number like `10-scriptname`. + +### Encryption + +To make sure the backups are safe we use openssl encryption option provided by +LBU. Please make sure you provide a secure password in `rbu.conf` and make sure +you have a backup of that password in case you will need it when restoring. + +### Include non etc files + +By default LBU will only backup files located in the `/etc` directory and have +been modified. To include other files you need to lbu_include files and +directories. Exclusion is possible via lbu_exclude. Please check Alpine wiki for +more information regarding LBU usage. + +### Backup server + +Backups will be kept in the specified backup location in rbu.conf. After the +backup is successful these backups will be rsynced to the remote backup server. +To be able to automatically rsync backups a ssh key needs to be generated per +backup. For generating a Ed25519 key exec: `ssh-keygen -t ed25519` and copy the +public key to the backup server. + +### Enable daily backups + +Copy the provided `alpine-backup.cron` as `/etc/periodic/daily/alpine-backup` to +make the backup run every night. + +## Backup monitoring + +Backups are are automatically monitored by Alpine monitoring system. After the +backup has finished it will send a message with metadata to our mqtt server +which will be picked up by Alpine monitoring system. + +## NOTE + +Older version of LBU have a bug which prevents the cleanup of older local +encrypted backups. see: +https://git.alpinelinux.org/cgit/alpine-conf/commit/?id=cd395b
\ No newline at end of file |