This is the runlevel.ch backup framework developed by Roland Hansmann
Tested on platform families ''debian'' and ''redhat''
- lsb_release
- mailx (bsd version)
- keychain
- rdiff-backup
The easiest way is to use the Ansible role. It will install all necessary dependencies and download the framework from github
$ ansbile-galaxy install rediculum.runlevel_backup
Clone the github repos
git clone https://github.com/rediculum/runlevel_backup.git
Create the directory
sudo mkdir -p /opt/runlevel_backup
Copy data
sudo cp -r opt/runlevel_backup/* /opt/runlevel_backup
sudo cp -r etc/cron.d/* /etc/cron.d
Generate SSH Keys
ssh-keygen -t ed25519 -C runlevel_backup -f /opt/runlevel_backup/backup.key -q -N ""
Put the public key into root's authorized_keys
and specify the command restriction for more security
command="/opt/runlevel_backup/backup_ssh_cmnd.sh",no-agent-forwarding,no-port-forwarding,no-user-rc,no-X11-forwarding,no-pty ssh-ed25519 AAAAXXXXXXXXXXXXXX runlevel_backup
Put the private key in to default/main.yml and see the other available vars in the role's default/main.yml if you want to override them
Edit the file /opt/runlevel_backup/backup.conf
and change the variables to fit your needs:
FOLDERS
- Array of folders to backupBACKUPSERVER
- Targert server for backupBACKUPDIR
- Target directory on backup serverPKGLIST
- Location of package listMYSQLBACKUP
- Backup MySQL?MYSQLUSER
- MySQL userMYSQLPASS
- MySQL passwordMYSQLBACK
- MySQL dump directoryPOSTGRESBACKUP
- Backup Postgres?PGSQLBACK
- Postgres dump directoryLDAPBACKUP
- Backup LDAP?LDAPBACK
- LDAP dump directoryLDIFFILE
- LDIF file nameRETENTION
- How many backup to keep in monthsEMAIL
- Email recipient for notificationFROM
- From address
Edit the cron file /etc/cron.d/runlevel_backup
if you want to change the time when a backup is performed
Place the private key in /opt/runlevel_backup/backup.key with perms 400.
This project is licensed under the GNU Affero General Public License v3.0 License - see the LICENSE file for details
- Roland Hansmann - Initial work - Roland Hansmann
See also the list of contributors who participated in this project.