Affa Sample Configurations
The home directories of all users should be backed up every two hours during the office hours. Backups should be kept for four weeks.
[fileserver] remoteHostName=172.22.32.2 Description=Workgroup Server TimeSchedule=0815 TimeSchedule=1015 TimeSchedule=1215 TimeSchedule=1415 TimeSchedule=1615 TimeSchedule=1815 Include=/home RootDir=/var/affa scheduledKeep=6 dailyKeep=7 weeklyKeep=4 monthlyKeep=0 yearlyKeep=0 status=enabled
Linux Server with MySQL Database
This example shows how to back up a CentOS Linux server running Mediawiki. The pre-job command runs a MySQL dump on the remote server. The dump is placed in the /tmp/MySQL-Dumps directory. The used script mysql-dump-tables is part of the package. To grant user root permissions to dump MySQL databases, the MySQL password was placed in /root/.my.cnf:
This sample was taken from a real setup, so adjust the Includes to your needs.
[IT-Wiki] remoteHostName=10.204.104.24 Description=IT-Wiki TimeSchedule=1010 TimeSchedule=1255 TimeSchedule=1610 TimeSchedule=1940 preJobCommandRemote=mysql-dump-tables Include=/tmp/MySQL-Dumps Include=/etc/group Include=/etc/gshadow Include=/etc/httpd/conf.d Include=/etc/httpd/conf/httpd.conf Include=/etc/openldap/ Include=/etc/passwd Include=/etc/php.ini Include=/etc/rc.d/rc0.d Include=/etc/rc.d/rc1.d Include=/etc/rc.d/rc2.d Include=/etc/rc.d/rc3.d Include=/etc/rc.d/rc4.d Include=/etc/rc.d/rc5.d Include=/etc/rc.d/rc6.d Include=/etc/rc.d/rc.local Include=/etc/samba Include=/etc/shadow Include=/etc/ssh Include=/etc/sudoers Include=/home Exclude=/home/httpd/webdav/mnt/ Include=/opt Include=/root Include=/usr/local/bin/vi Include=/usr/share/phpmyadmin Include=/var/www/html Include=/var/www/.ssh RootDir=/var/affa scheduledKeep=3 dailyKeep=7 weeklyKeep=4 monthlyKeep=12 yearlyKeep=1 status=enabled
The fileshares it_docs and it_sw on a QNAP NAS device need to be backed up. As the QNAP does not allow root ssh login und the authorized keys are not stored in the standard location the properties remoteUser and RemoteAuthorizedKeysFile must be set accordingly.
[qnap-4] remoteHostName=qn4.my.lan RemoteAuthorizedKeysFile=/etc/config/ssh/authorized_keys2 remoteUser=admin TimeSchedule=1900 Include=/share/MD0_DATA/it_docs Include=/share/MD0_DATA/it_sw dedup=yes status=enabled
Backup of Windows Server Directory using Rsyncd
The Windows Active Directory-Server ads runs a AD snapshot daily at 8:00 pm and places it in C:\Backup. An Affa job is to be configured to back up this directory.
gid = 544 uid = 18 hosts allow = affa-1.mydomain.com affa-3.mydomain.com affa-2.mydomain.com auth users = affa secrets file = /etc/rsyncd.secrets strict modes = true read only = true use chroot = no transfer logging = true log format = %h %o %f %l %b log file = /var/log/rsyncd.log [AD-BACKUP] path = /cygdrive comment = Active Directory Backup
Change the host allow line to a space separated list of IP addresses or FQHN of your Affa servers.
Affa job configuration to back up the C:\Backup directory at 8:30 pm
[ads] remoteHostName=ads.mydomain.com remoteUser=Administrator TimeSchedule=2030 Description=Active Directory Snapshot rsyncdMode=yes rsyncdModule=AD-BACKUP rsyncdUser=affa rsyncdPassword=Ks7+uEvo=g3aaf Include=/c/Backup RootDir=/var/affa scheduledKeep=1 dailyKeep=7 weeklyKeep=4 monthlyKeep=3 yearlyKeep=0 rsyncCompress=yes status=enabled
Backup of Windows Workstation Directory using Rsyncd
The Lightroom catalog from a Windows Workstation is to back up. The computer is not powered on all the time. Affa should start when the computer is running. The following configuration sets up a job that starts 8.00 am and retries each quarter-hour throughout the day. As soon as the computer has been powered up Affa will complete the job. The EmailAddress property is set to an empty value to avoid noisy messages. The Nagios monitor warns when no backup was made the last 10 days (NRPEtrigger=240). Watch the result of a similar setup on Affa Live
[lightroom] Description=Lightroom Catalog of Marketing Dep. remoteHostName=10.204.8.71 remoteUser=Administrator rsyncdMode=yes rsyncdModule=LR rsyncdUser=affa rsyncdPassword=H7zz-pW-35t TimeSchedule=0800 RetryAttempts=48 RetryAfter=900 RetryNotification=no NRPEtrigger=240 EmailAddress= RootDir=/var/affa Include=/ scheduledKeep=1 dailyKeep=7 weeklyKeep=4 monthlyKeep=12 yearlyKeep=1 status=enabled
This example shows a method how to back up Windows computer by mounting a Windows file share to the Affa server. No rsyncd installation is required on the Windows computer. Assume that the share buha-data on the Windows Server ak-ads should be backed up.
First create the mount point
mkdir -p /mnt/buha
The create the credentials /etc/affa/buha.secret file for logging into the share
Set strict permissions
chmod 600 /etc/affa/buha.secret
Now create /etc/affa/buha.conf with a job section
[buha] remoteHostName=localhost Description=Buha Data AutomountDevice=//ak-ads/buha-data AutomountPoint=/mnt/buha AutomountOptions=-t cifs -o credentials=/etc/affa/buha.secret AutoUnmount=yes TimeSchedule=2015 Include=/mnt/buha scheduledKeep=3 dailyKeep=7 weeklyKeep=4 monthlyKeep=12 yearlyKeep=1 RootDir=/var/affa rsync--modify-window=600 status=enabled
Send the public key
affa --send-key buha
and run the job manually
affa --run buha
Backup of SME Server 7
Use this configuration if you still have SME Servers to back up.
[fespdc] remoteHostName=10.204.104.1 Description=DC and Fileserver TimeSchedule=1930 preJobCommandRemote=SME/signal-pre-backup postJobCommandRemote=SME/signal-post-backup Include=/etc/e-smith/templates-custom Include=/etc/e-smith/templates-user-custom Include=/etc/group Include=/etc/gshadow Include=/etc/passwd Include=/etc/samba/secrets.tdb Include=/etc/samba/smbpasswd Include=/etc/shadow Include=/etc/smbpasswd Include=/etc/ssh Include=/etc/sudoers Include=/home/e-smith Include=/root scheduledKeep=3 dailyKeep=7 weeklyKeep=4 monthlyKeep=12 yearlyKeep=1 RootDir=/var/affa status=enabled
Please leave your comments and suggestions on the discussion page.