Changes

Jump to navigation Jump to search
4,464 bytes removed ,  22:34, 27 September 2021
Remove most references to earlier obsolete versions
Line 3: Line 3:  
{{usefulnote}}
 
{{usefulnote}}
   −
=== Maintainer ===
+
===Maintainer===
Mainteners(s) Affa3: Arnaud, stephdl (and please see above note.)<br>
+
Maintainers(s) Affa3: Arnaud, stephdl (and please see above note.)<br>
 
Copyright (C) 2004-2012 by Michael Weinberger<br>
 
Copyright (C) 2004-2012 by Michael Weinberger<br>
=== Version ===
+
===Version===
 
{{#smeversion: smeserver-affa}}
 
{{#smeversion: smeserver-affa}}
   −
=== Description ===
+
===Description===
 
The main purpose of this affa package is to make a SME Server a dedicated backup box in a few minutes. Affa backs up as many SME servers as you like or any other servers which have sshd running and rsync installed. Once it is configured, Affa runs reliably unattended and sends warning messages in case of any errors.  
 
The main purpose of this affa package is to make a SME Server a dedicated backup box in a few minutes. Affa backs up as many SME servers as you like or any other servers which have sshd running and rsync installed. Once it is configured, Affa runs reliably unattended and sends warning messages in case of any errors.  
   Line 26: Line 26:  
'''Note:''' This document also refers to the Affa Version 2 which is not maintained anymore. Information on Affa 3 will be gradually added here once it has been more tested.
 
'''Note:''' This document also refers to the Affa Version 2 which is not maintained anymore. Information on Affa 3 will be gradually added here once it has been more tested.
   −
==== Affa features at a glance ====
+
====Affa features at a glance====
* Affa is secure: All transfers and connections are made by using the ssh protocol with public/private key authentication
  −
* Periodically runs unattended full backups. Only differences to the previous full backup are transferred over the network
  −
* Using rsync with optional bandwidth limit and compression allows backups over the internet
  −
* Uses hardlink technique, i.e. physical disk space only needed for the differences between two full backups
  −
* Keeps a configurable number of scheduled, daily, weekly, monthly and yearly full backup archives
  −
* The archives are browseable. No need to unpack them first.
  −
* Archives can be mapped to a Samba share.
  −
* Backup jobs are started by the cron daemon
  −
* Interrupted jobs continuing with already transfered data when restarted
  −
* Backups the default e-smith directories and files, when property SMEServer is set to yes
  −
* Additional directories and files can be included
  −
* Directories and files can be excluded from the backup
  −
* Non-SME server linux systems can be backed up by setting the SMEServer property to no and using an include list
  −
* In ESXi mode, running virtual machines can be backed up. See [[Backup of ESXi Virtual Machines using Affa]]
  −
* Configurable nice level for rsync processes on the backup and source server
  −
* Optional run of custom programs before and after a job run (e.g. running tape backup)
  −
* Checks the disk space left after a job run with warning levels strict, normal or risky
  −
* Extensive checking of failure conditions
  −
* Sends failure messages to a configurable list of email addresses
  −
* Sends a warning message, if the backup server runs out of disk space
  −
* Installs an optional watchdog on the source server in case the backupserver fails (SME Server only)
  −
* Watchdog sends warning, if an expected backup did not run (SME Server only)
  −
* Watchdog sends a daily reminder message, if the error continues unchecked (SME Server only)
  −
* Option to display current status of all jobs showing times of last and next run, size and disk usage
  −
* Status can be mailed on a daily, weekly or monthly schedule
  −
* Option to display all existing archives of a job shown date, number of files, size and bytes tranferred from the source
  −
* Option to send (and revoke) the public key to the source server (SME Server and ESXi only)
  −
* Option to rise the backup server to a production server from a backup (SME Server only)
  −
* The rise feature does not physically move data and therefore is extremly fast and needs (almost) no extra disk space
  −
* Rise option can be run remotely as the NIC driver configuration of the backup server are preserved
  −
* Compares installed RPMs on source with backup server. Sends warning message, if not in sync
  −
* Undo rise option to restore the backup server
  −
* Configurable via a e-smith style db, with one record for each job and a default record for all jobs
  −
* Logs to /var/log/affa/JOB.log and /var/log/affa/affa.log with optional debug switch for higher verbosity
  −
* Log files are rotated weekly, with 5 logs kept
     −
<div class="mw-collapsible mw-collapsed" style="text-align:left" data-expandtext="Obsolete Affa 2 instructions &darr;" data-collapsetext="less &uarr;">
+
*Affa is secure: All transfers and connections are made by using the ssh protocol with public/private key authentication
 +
*Periodically runs unattended full backups. Only differences to the previous full backup are transferred over the network
 +
*Using rsync with optional bandwidth limit and compression allows backups over the internet
 +
*Uses hardlink technique, i.e. physical disk space only needed for the differences between two full backups
 +
*Keeps a configurable number of scheduled, daily, weekly, monthly and yearly full backup archives
 +
*The archives are browseable. No need to unpack them first.
 +
*Archives can be mapped to a Samba share.
 +
*Backup jobs are started by the cron daemon
 +
*Interrupted jobs continuing with already transfered data when restarted
 +
*Backups the default e-smith directories and files, when property SMEServer is set to yes
 +
*Additional directories and files can be included
 +
*Directories and files can be excluded from the backup
 +
*Non-SME server linux systems can be backed up by setting the SMEServer property to no and using an include list
 +
*In ESXi mode, running virtual machines can be backed up. See [[Backup of ESXi Virtual Machines using Affa]]
 +
*Configurable nice level for rsync processes on the backup and source server
 +
*Optional run of custom programs before and after a job run (e.g. running tape backup)
 +
*Checks the disk space left after a job run with warning levels strict, normal or risky
 +
*Extensive checking of failure conditions
 +
*Sends failure messages to a configurable list of email addresses
 +
*Sends a warning message, if the backup server runs out of disk space
 +
*Installs an optional watchdog on the source server in case the backupserver fails (SME Server only)
 +
*Watchdog sends warning, if an expected backup did not run (SME Server only)
 +
*Watchdog sends a daily reminder message, if the error continues unchecked (SME Server only)
 +
*Option to display current status of all jobs showing times of last and next run, size and disk usage
 +
*Status can be mailed on a daily, weekly or monthly schedule
 +
*Option to display all existing archives of a job shown date, number of files, size and bytes tranferred from the source
 +
*Option to send (and revoke) the public key to the source server (SME Server and ESXi only)
 +
*Option to rise the backup server to a production server from a backup (SME Server only)
 +
*The rise feature does not physically move data and therefore is extremly fast and needs (almost) no extra disk space
 +
*Rise option can be run remotely as the NIC driver configuration of the backup server are preserved
 +
*Compares installed RPMs on source with backup server. Sends warning message, if not in sync
 +
*Undo rise option to restore the backup server
 +
*Configurable via a e-smith style db, with one record for each job and a default record for all jobs
 +
*Logs to /var/log/affa/JOB.log and /var/log/affa/affa.log with optional debug switch for higher verbosity
 +
*Log files are rotated weekly, with 5 logs kept
   −
{{Warning box|SME v7/8 are no longer supported and these instructions will be removed soon}}
+
<div class="mw-collapsible mw-collapsed" style="text-align:left" data-expandtext="Obsolete Affa 2 instructions &darr;" data-collapsetext="less &uarr;">{{Warning box|SME v7/8/9 are no longer supported.}}
 
  −
=== Installation or Update of Affa 2 ===
  −
 
  −
====Smecontribs for sme8====
  −
yum install --enablerepo=smecontribs smeserver-affa
  −
 
  −
The latest test version can be found here :
  −
[http://www.reetspetit.com/smeserver/5/noarch/smeserver-affa-2.0.0-rc6.el5.sme.noarch.rpm smeserver-affa-2.0.0-rc6.el5.sme.noarch.rpm]  Note this is NOT signed.
  −
 
  −
Please post bug reports in the [http://bugs.contribs.org bug tracker]
  −
 
  −
When you have installed Affa for the first time run the following command to initialize the Affa database
  −
 
  −
affa --make-cronjobs
  −
 
  −
and logout and re-login to the console to take the bash auto-completion (TAB key) in effect.
  −
 
  −
====Obsolete way to install====
  −
{{Note box|SME7 is now EOL and has been moved to the obsolete tree}}
  −
SME7 version: '''smeserver-affa-2.0.0-rc4.noarch.rpm'''
  −
wget <nowiki>http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/Affa2/smeserver-affa-2.0.0-rc4.noarch.rpm</nowiki>
  −
wget <nowiki>http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/Affa2/perl-Compress-Bzip2-2.09-1.2.el4.rf.i386.rpm</nowiki>
  −
/usr/bin/yum --enablerepo=smecontribs localinstall \
  −
smeserver-affa-2.0.0-rc4.noarch.rpm \
  −
perl-Compress-Bzip2-2.09-1.2.el4.rf.i386.rpm
  −
 
  −
SME8 version: SME8 is based on CentOS5, therefore use the perl-Compress-Bzip2 el5 rpm:
  −
wget <nowiki>http://mirror.contribs.org/releases/8/smecontribs/i386/repoview/smeserver-affa.html</nowiki>
  −
For SME8 32bit:
  −
wget <nowiki>http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/perl-Compress-Bzip2-2.09-1.2.el5.rf.i386.rpm</nowiki>
  −
/usr/bin/yum --enablerepo=smecontribs localinstall \
  −
smeserver-affa-2.0.0-rc4.noarch.rpm \
  −
perl-Compress-Bzip2-2.09-1.2.el5.rf.i386.rpm
  −
For SME8 64bit:
  −
wget http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/perl-Compress-Bzip2-2.09-1.2.el5.rf.x86_64.rpm
  −
/usr/bin/yum --enablerepo=smecontribs localinstall \
  −
smeserver-affa-2.0.0-rc4.noarch.rpm \
  −
perl-Compress-Bzip2-2.09-1.2.el5.rf.x86_64.rpm
  −
 
  −
When you have installed Affa for the first time run the following command to initialize the Affa database
  −
affa --make-cronjobs
  −
and logout and re-login to the console to take the bash auto-completion (TAB key) in effect.
  −
 
  −
==== Quick start example for Affa 2 ====
  −
You have a SME 7 production server with hostname 'prodbox‘ and IP 10.200.48.1.<br>
  −
Set up a second SME 7 box as your backupserver with hostname 'affabox‘ and IP 10.200.48.2.
  −
 
  −
<ol><li>log into the 'affabox' and install the packages as described above.
  −
</li><li>copy the config helper script sample
  −
cp /usr/lib/affa/jobconfig-sample.pl /root/prodbox-job.pl
  −
</li><li>edit /root/prodbox-job.pl and set
  −
my $jobname='prodbox';
  −
and
  −
  −
'remoteHostName‘=>'10.200.48.1',
  −
 
  −
optionally, if the remote server port is configured to e.g. 2222 then set
  −
  −
'sshPort'=>2222,
  −
</li><li>save and run the 'prodbox-job.pl' file. This will write the configuration (this makes the database entries and sets up the cronjobs)
  −
/root/prodbox-job.pl
  −
</li><li>generate the DSA keys and send the public key to the 'prodbox'
  −
{{Note box|When initially doing this step, you will need to temporarily enable "Allow secure shell access using standard passwords" on the production server}}
  −
affa --send-key prodbox
  −
</li><li>run the job manually
  −
 
  −
affa --run prodbox
  −
</li></ol>
  −
 
  −
==== Configuration ====
  −
The configuration is stored in an e-smith style database. Use the db command to configure Affa.
  −
The jobname is the record key with the type 'job'.<br>To setup a new job with the name 'prodbox' enter:
  −
 
  −
db affa set prodbox job
  −
 
  −
then set the properties
  −
 
  −
db affa setprop prodbox remoteHostName 192.168.1.1
  −
db affa setprop prodbox TimeSchedule '0030,0730,1130,1330,1730,2030'
  −
db affa setprop prodbox Description 'My Production Server'
  −
db affa setprop prodbox status enabled
  −
and so on...
  −
 
  −
Alternatively you can you use a script as described above in the 'Quick start' chapter.
  −
 
  −
To verify your work, type:
  −
 
  −
db affa show prodbox
  −
 
  −
Finally set up the cronjobs:
  −
affa --make-cronjobs
      
</div>
 
</div>
   −
 
+
===Installation of Affa 3===
=== Installation of Affa 3 ===
   
The following instructions assume that a fresh Affa 3 installation is made on a fresh dedicated SME server which serves as a dedicated backup server ('affabox‘). No jobs are migrated from Affa 2. For using an existing SME server, just skip the instructions how to setup a fresh SME box.
 
The following instructions assume that a fresh Affa 3 installation is made on a fresh dedicated SME server which serves as a dedicated backup server ('affabox‘). No jobs are migrated from Affa 2. For using an existing SME server, just skip the instructions how to setup a fresh SME box.
   Line 188: Line 95:       −
= For SME9 =
+
   −
yum install smeserver-affa --enablerepo=smecontribs
+
=For SME10=
 
  −
= For SME10 =
      
There is a new development version 3.3.1
 
There is a new development version 3.3.1
   −
{{Warning box|This will almost certainly break both your old backups and you new server. ONLY use this in a test scenario until it is fully released}}
+
{{Warning box|This will almost certainly break both your old backups and your new server. ONLY use this in a test scenario until it is fully released}}
    
{{Warning box|Do not use the ANY Koozali SME v9 affa versions with v10. It will probably break both your backups and your new server}}
 
{{Warning box|Do not use the ANY Koozali SME v9 affa versions with v10. It will probably break both your backups and your new server}}
Line 228: Line 133:  
{{Warning box| Note that on SME9, a new SSH [https://wiki.contribs.org/AutoBlock AutoBlock] feature interferes with the Affa requirement for regular SSH logins! You might have to disable this feature to allow Affa to operate correctly. }}
 
{{Warning box| Note that on SME9, a new SSH [https://wiki.contribs.org/AutoBlock AutoBlock] feature interferes with the Affa requirement for regular SSH logins! You might have to disable this feature to allow Affa to operate correctly. }}
   −
=== Creation of backup jobs ===
+
===Creation of backup jobs===
 
Job configurations of Affa 3 are no longer stored in an e-smith style database. They are stored in configuration files located in ''/etc/affa'' . Create your configuration files in this directory, e.g.
 
Job configurations of Affa 3 are no longer stored in an e-smith style database. They are stored in configuration files located in ''/etc/affa'' . Create your configuration files in this directory, e.g.
 
  touch /etc/affa/backup-smeserver.conf
 
  touch /etc/affa/backup-smeserver.conf
 
where ''backup-smeserver'' is your jobname, and add content as described below.
 
where ''backup-smeserver'' is your jobname, and add content as described below.
   −
==== Quick start example ====
+
====Quick start example====
 
You have a SME production server with hostname 'smeserver‘ and IP 192.168.0.2.<br>
 
You have a SME production server with hostname 'smeserver‘ and IP 192.168.0.2.<br>
 
You have a second SME box as your backup server with hostname 'affabox‘ and IP 192.168.0.10.  
 
You have a second SME box as your backup server with hostname 'affabox‘ and IP 192.168.0.10.  
Line 295: Line 200:  
From here you are able to work as with Affa 2. Modify your config file as required and described below. Automate the backup using the command ''affa --make-cronjobs'', see below.
 
From here you are able to work as with Affa 2. Modify your config file as required and described below. Automate the backup using the command ''affa --make-cronjobs'', see below.
   −
==== Job configuration properties ====
+
====Job configuration properties====
 
'''Note 1:''' The default values shown in this table are the Affa program defaults and not to be confused with the preset values in the job configuration files, e.g. backup-smeserver.conf.
 
'''Note 1:''' The default values shown in this table are the Affa program defaults and not to be confused with the preset values in the job configuration files, e.g. backup-smeserver.conf.
   Line 310: Line 215:  
{| border="1" cellspacing="0" cellpadding="3"
 
{| border="1" cellspacing="0" cellpadding="3"
 
|-
 
|-
| '''Property''' || '''Value''' || '''Multivalue''' || '''Default''' || '''Description'''  
+
|'''Property'''||'''Value'''||'''Multivalue'''||'''Default'''||'''Description'''
 
|-
 
|-
| remoteHostName  
+
|remoteHostName
| FQHN or IP
+
|FQHN or IP
| no
+
|no
| <none>
+
|<none>
| FQHN or IP of the source host (mandatory)
+
|FQHN or IP of the source host (mandatory)
 
|-
 
|-
| remoteUser
+
|remoteUser
| account
+
|account
| no
+
|no
| root
+
|root
| The user account to be used with all ssh logins. May be case sensitive, e.g. Administrator account on Windows
+
|The user account to be used with all ssh logins. May be case sensitive, e.g. Administrator account on Windows
 
|-
 
|-
| Description
+
|Description
| text string
+
|text string
| no
+
|no
| <none>
+
|<none>
| Any text that describes the job
+
|Any text that describes the job
 
|-
 
|-
| TimeSchedule  
+
|TimeSchedule
| HHMM
+
|HHMM
| yes
+
|yes
| 2230
+
|2230
| The time the job will run. Use exactly 4 digits, no colon, no point. '''Important:''' Using the proper format HHMM is essential. Badly formatted TimeSchedule will cause strange Perl errors.  Multiple times can be achieved by repeating the line, each line with a different time.
+
|The time the job will run. Use exactly 4 digits, no colon, no point. '''Important:''' Using the proper format HHMM is essential. Badly formatted TimeSchedule will cause strange Perl errors.  Multiple times can be achieved by repeating the line, each line with a different time.
 
|-
 
|-
| status  
+
|status
| enabled ''or'' disabled
+
|enabled ''or'' disabled
| no
+
|no
| enabled
+
|enabled
| When set to disabled, no cron entries will made. You can still run a job manually.  
+
|When set to disabled, no cron entries will made. You can still run a job manually.
 
|-
 
|-
| Include
+
|Include
| full path
+
|full path
| yes
+
|yes
| <none>
+
|<none>
| File(s) or directory(s) to be included in the backup.  
+
|File(s) or directory(s) to be included in the backup.
 
|-
 
|-
| Exclude
+
|Exclude
| full path
+
|full path
| yes
+
|yes
| <none>
+
|<none>
| File(s) or directory(s) to be excluded from the backup.  
+
|File(s) or directory(s) to be excluded from the backup.
 
|-
 
|-
| RootDir
+
|RootDir
| full path
+
|full path
| no
+
|no
| /var/affa
+
|/var/affa
| where to store the backup archives. Do not use /home/e-smith or /root as these are included in the backup and therefore the rise option will not work! Recommended: /var/affa
+
|where to store the backup archives. Do not use /home/e-smith or /root as these are included in the backup and therefore the rise option will not work! Recommended: /var/affa
 
|-
 
|-
| scheduledKeep
+
|scheduledKeep
| integer >= 1
+
|integer >= 1
| no
+
|no
| 1
+
|1
| how many of the scheduled backups to be kept
+
|how many of the scheduled backups to be kept
 
|-
 
|-
| dailyKeep
+
|dailyKeep
| integer >= 0
+
|integer >= 0
| no
+
|no
| 7
+
|7
| how many of the daily backups to be kept
+
|how many of the daily backups to be kept
 
|-
 
|-
| weeklyKeep
+
|weeklyKeep
| integer >= 0
+
|integer >= 0
| no
+
|no
| 4
+
|4
| how many of the weekly backups to be kept
+
|how many of the weekly backups to be kept
 
|-
 
|-
| monthlyKeep
+
|monthlyKeep
| integer >= 0
+
|integer >= 0
| no
+
|no
| 12
+
|12
| how many of the monthly backups to be kept
+
|how many of the monthly backups to be kept
 
|-
 
|-
| yearlyKeep
+
|yearlyKeep
| integer >= 0
+
|integer >= 0
| no
+
|no
| 2
+
|2
| how many of the yearly backups to be kept
+
|how many of the yearly backups to be kept
 
|-
 
|-
| EmailAddress
+
|EmailAddress
| name@domain.com
+
|name@domain.com
| yes
+
|yes
| root
+
|root
| comma separated list of mail addresses, where the messages should be sent to<br>'''Note:''' By default Affa only sends messages on errors, never on success (see property chattyOnSuccess).
+
|comma separated list of mail addresses, where the messages should be sent to<br>'''Note:''' By default Affa only sends messages on errors, never on success (see property chattyOnSuccess).
 
|-
 
|-
| RetryAttempts
+
|RetryAttempts
| integer >= 0
+
|integer >= 0
| no
+
|no
| 4
+
|4
| When set to a value>0, Affa re-run a failed job RetryAttempts times with a delay of RetryAfter seconds.
+
|When set to a value>0, Affa re-run a failed job RetryAttempts times with a delay of RetryAfter seconds.
 
|-
 
|-
| RetryAfter
+
|RetryAfter
| seconds >= 0
+
|seconds >= 0
| no
+
|no
| 900
+
|900
| when set to a value>0, wait RetryAfter seconds before re-running the job after an error. Only applicable with RetryAttempts>0
+
|when set to a value>0, wait RetryAfter seconds before re-running the job after an error. Only applicable with RetryAttempts>0
 
|-
 
|-
| RetryNotification
+
|RetryNotification
| yes ''or'' no
+
|yes ''or'' no
| no
+
|no
| no
+
|no
| when set to no, Affa does not send an error message when a job has failed and RetryAttempts is configured. An error message is only sent when the last attempt has failed.
+
|when set to no, Affa does not send an error message when a job has failed and RetryAttempts is configured. An error message is only sent when the last attempt has failed.
 
|-
 
|-
| NRPEtrigger
+
|NRPEtrigger
| hours
+
|hours
| no
+
|no
| 24
+
|24
| NRPE reports a job as critical when the last successful run is older then NRPEtrigger hours. To exclude the job from monitoring set to a value < 0.
+
|NRPE reports a job as critical when the last successful run is older then NRPEtrigger hours. To exclude the job from monitoring set to a value < 0.
 
|-
 
|-
| SambaShare
+
|SambaShare
| yes ''or'' no
+
|yes ''or'' no
| no
+
|no
| no
+
|no
| Access to the job archives via CIFS protocol.
+
|Access to the job archives via CIFS protocol.
 
|-
 
|-
| SambaValidUser
+
|SambaValidUser
| local account
+
|local account
| yes
+
|yes
| affa
+
|affa
| User who has permission to access the job archives via the CIFS protocol.
+
|User who has permission to access the job archives via the CIFS protocol.
 
|-
 
|-
| preJobCommand<br> preJobCommandRemote
+
|preJobCommand<br> preJobCommandRemote
| path relative to /etc/affa/scripts/
+
|path relative to /etc/affa/scripts/
| yes
+
|yes
| <none>
+
|<none>
| Scripts to be executed before a job run. The job name and type (scheduled, daily etc.) are passed as arguments to the program. The preJobCommandRemote scripts are copied to the remote server and then executed there. The scripts are executed in alphabetical order. Use a numerical prefix if you need a specific order e.g. 01scriptB, 02remotescriptA, 03scriptA. Use the included prescript-sample.pl and prescriptRemote-sample.pl as a starting point for own scripts.<br>'''Note:''' If you use the parameter “SMEServer=yes”, you may delete the “Included” relative to SME default directories in the jobconfig.ini: they will be backuped automatically.
+
|Scripts to be executed before a job run. The job name and type (scheduled, daily etc.) are passed as arguments to the program. The preJobCommandRemote scripts are copied to the remote server and then executed there. The scripts are executed in alphabetical order. Use a numerical prefix if you need a specific order e.g. 01scriptB, 02remotescriptA, 03scriptA. Use the included prescript-sample.pl and prescriptRemote-sample.pl as a starting point for own scripts.<br>'''Note:''' If you use the parameter “SMEServer=yes”, you may delete the “Included” relative to SME default directories in the jobconfig.ini: they will be backuped automatically.
 
|-
 
|-
| postJobCommand<br> postJobCommandRemote
+
|postJobCommand<br> postJobCommandRemote
| path relative to /etc/affa/scripts/
+
|path relative to /etc/affa/scripts/
| yes
+
|yes
| <none>
+
|<none>
| Scripts to be executed after a job run. The job name, the type (scheduled, daily etc.) and the exit code of the job run are passed as arguments to the program. The postJobCommandRemote scripts are copied to the remote server and then executed there. The scripts are executed in alphabetical order. Use a numerical prefix if you need a specific order e.g. 01scriptB, 02remotescriptA, 03scriptA. Use the included postscript-sample.pl and postscriptRemote-sample.pl as a starting point for own scripts.<br>'''Note:''' If you use the parameter “SMEServer=yes”, you may delete the “Included” relative to SME default directories in the jobconfig.ini: they will be backuped automatically.
+
|Scripts to be executed after a job run. The job name, the type (scheduled, daily etc.) and the exit code of the job run are passed as arguments to the program. The postJobCommandRemote scripts are copied to the remote server and then executed there. The scripts are executed in alphabetical order. Use a numerical prefix if you need a specific order e.g. 01scriptB, 02remotescriptA, 03scriptA. Use the included postscript-sample.pl and postscriptRemote-sample.pl as a starting point for own scripts.<br>'''Note:''' If you use the parameter “SMEServer=yes”, you may delete the “Included” relative to SME default directories in the jobconfig.ini: they will be backuped automatically.
 
|-
 
|-
| dedup
+
|dedup
| yes ''or'' no
+
|yes ''or'' no
| no
+
|no
| no
+
|no
| The purpose of the deduplication is to remove duplicate files to save backup space. When set to 'yes' file deduplication is run after the synchronization has been completed. It looks for files that have identical content, user, group and permissions and replace duplicates by hardlinks. Deduplication scans the just completed archive and the previous one, that usually is
+
|The purpose of the deduplication is to remove duplicate files to save backup space. When set to 'yes' file deduplication is run after the synchronization has been completed. It looks for files that have identical content, user, group and permissions and replace duplicates by hardlinks. Deduplication scans the just completed archive and the previous one, that usually is
 
scheduled.0 and daily.0 or scheduled.0 and scheduled.1. Consider this scenario: A user has renamed directories or files. Rsync sees those as new ones and copies them. Deduplication finds the identical copies in the previous archive and replace them by hardlinks. To use deduplication the Freedup program needs to be installed. Affa actually runs freedup -upg scheduled.0 <previous_archive>.
 
scheduled.0 and daily.0 or scheduled.0 and scheduled.1. Consider this scenario: A user has renamed directories or files. Rsync sees those as new ones and copies them. Deduplication finds the identical copies in the previous archive and replace them by hardlinks. To use deduplication the Freedup program needs to be installed. Affa actually runs freedup -upg scheduled.0 <previous_archive>.
 
|-
 
|-
| dedupKill
+
|dedupKill
| yes ''or'' no
+
|yes ''or'' no
| no
+
|no
| no
+
|no
| When set to 'no' the job ignores affa --kill or affa --killall when deduplication is running. This is useful in the context of killAt which is typically used to stop bandwith utilisation.
+
|When set to 'no' the job ignores affa --kill or affa --killall when deduplication is running. This is useful in the context of killAt which is typically used to stop bandwith utilisation.
 
|-
 
|-
| DiskSpaceWarn
+
|DiskSpaceWarn
| strict ''or'' normal ''or'' risky ''or'' none
+
|strict ''or'' normal ''or'' risky ''or'' none
| no
+
|no
| strict
+
|strict
| Checks disk space remainin on the backup device and issue a warning via email.
+
|Checks disk space remainin on the backup device and issue a warning via email.
 
|-
 
|-
| sshPort
+
|sshPort
| service port  
+
|service port
| no
+
|no
| 22
+
|22
| When sshd on the remote host listens on a non-standard port, set the port here.
+
|When sshd on the remote host listens on a non-standard port, set the port here.
 
|-
 
|-
| ConnectionCheckTimeout
+
|ConnectionCheckTimeout
| seconds
+
|seconds
| no
+
|no
| 120
+
|120
| Affa checks the ssh connection before the rsync process is started and exits with an error after the configured time if the host did not respond.
+
|Affa checks the ssh connection before the rsync process is started and exits with an error after the configured time if the host did not respond.
 
|-  
 
|-  
| BandwidthLimit
+
|BandwidthLimit
| integer>=0 kilobytes per second
+
|integer>=0 kilobytes per second
| no
+
|no
| 0
+
|0
| Limits the data transfer rate. A value of zero specifies no limit.
+
|Limits the data transfer rate. A value of zero specifies no limit.
 
|-  
 
|-  
| rsyncTimeout
+
|rsyncTimeout
| seconds
+
|seconds
| no
+
|no
| 900
+
|900
| Rsync exits after the configured time if no data was transferred. This avoids infinitely hanging in case of a network error.
+
|Rsync exits after the configured time if no data was transferred. This avoids infinitely hanging in case of a network error.
 
|-  
 
|-  
| rsyncCompress
+
|rsyncCompress
| yes ''or'' no  
+
|yes ''or'' no
| no
+
|no
| yes
+
|yes
| Compress the transferred data. May be useful with slow internet connections. Increases CPU load on remote and backup host.
+
|Compress the transferred data. May be useful with slow internet connections. Increases CPU load on remote and backup host.
 
|-  
 
|-  
| rsync--inplace
+
|rsync--inplace
| yes ''or'' no
+
|yes ''or'' no
| no
+
|no
| yes  
+
|yes
| Set to no if the rsync version on the remote hist does not support this option.
+
|Set to no if the rsync version on the remote hist does not support this option.
 
|-
 
|-
| rsync--modify-window
+
|rsync--modify-window
| integer >= 0  
+
|integer >= 0
| no
+
|no
| 0
+
|0
| When comparing two timestamps, rsync treats the timestamps as being equal if they differ by no more than the modify-window value. This is normally 0 for an exact match. A value >= 0 is useful if you can't get the clocks of the remote host and the Affa server in sync.
+
|When comparing two timestamps, rsync treats the timestamps as being equal if they differ by no more than the modify-window value. This is normally 0 for an exact match. A value >= 0 is useful if you can't get the clocks of the remote host and the Affa server in sync.
 
|-
 
|-
| rsyncOptions
+
|rsyncOptions
| string
+
|string
| no
+
|no
| <none>
+
|<none>
| Additional option string to be passed to rsync
+
|Additional option string to be passed to rsync
 
|-
 
|-
| localNice  
+
|localNice
 
| -19...+19
 
| -19...+19
| no
+
|no
| 0
+
|0
| run rsync local process niced.  
+
|run rsync local process niced.
 
|-
 
|-
| remoteNice
+
|remoteNice
 
| -19...+19
 
| -19...+19
| no
+
|no
| 0
+
|0
| run rsync process on source niced.  
+
|run rsync process on source niced.
 
|-
 
|-
| killAt
+
|killAt
| HHMM
+
|HHMM
| no
+
|no
| <none>
+
|<none>
| The time at which a job will be killed if it was still running. You can use it for example to kill jobs that are running over the internet early in the morning so that your users have the full bandwidth available during office hours.  
+
|The time at which a job will be killed if it was still running. You can use it for example to kill jobs that are running over the internet early in the morning so that your users have the full bandwidth available during office hours.
 
|-
 
|-
| resumeKilledAt
+
|resumeKilledAt
| HHMM
+
|HHMM
| no
+
|no
| <none>
+
|<none>
| The time at which a killed job will be resumed. This allows you to start earlier in the evening than the scheduled time.
+
|The time at which a killed job will be resumed. This allows you to start earlier in the evening than the scheduled time.
 
|-
 
|-
| chattyOnSuccess
+
|chattyOnSuccess
| integer >= 0
+
|integer >= 0
| no
+
|no
| 0  
+
|0
| When set to a value>0, Affa sends a message on a successfully completed job run and decrements the chattyOnSuccess value. When the value has reached zero, Affa falls back to the default and only sends messages on errors.
+
|When set to a value>0, Affa sends a message on a successfully completed job run and decrements the chattyOnSuccess value. When the value has reached zero, Affa falls back to the default and only sends messages on errors.
 
|-
 
|-
| AutomountDevice<br>AutomountPoint
+
|AutomountDevice<br>AutomountPoint
| full path
+
|full path
| no
+
|no
| <none>
+
|<none>
| Device and mountpoint of backup device (e.g. USB disk). Device is automounted before a job starts and unmounted after job completion. With both properties empty no automount is done.
+
|Device and mountpoint of backup device (e.g. USB disk). Device is automounted before a job starts and unmounted after job completion. With both properties empty no automount is done.
 
|-
 
|-
| AutomountOptions
+
|AutomountOptions
| string
+
|string
| no
+
|no
| <none>
+
|<none>
| An option string passed to the mount command.
+
|An option string passed to the mount command.
 
|-
 
|-
| AutoUnmount  
+
|AutoUnmount
| yes ''or'' no
+
|yes ''or'' no
| no
+
|no
| yes
+
|yes
| When set to 'no' the automounted device stay mounted after the Affa run.
+
|When set to 'no' the automounted device stay mounted after the Affa run.
 
|-
 
|-
| Debug  
+
|Debug
| yes ''or'' no
+
|yes ''or'' no
| no
+
|no
| no
+
|no
| Set to yes to increase log verbosity.
+
|Set to yes to increase log verbosity.
 
|-
 
|-
| remoteRsyncBinary  
+
|remoteRsyncBinary
| full path
+
|full path
| no
+
|no
| /usr/bin/rsync
+
|/usr/bin/rsync
| If the rsync program on the remote server is located in non-standard location, set it here
+
|If the rsync program on the remote server is located in non-standard location, set it here
 
|-
 
|-
| remoteNiceBinary  
+
|remoteNiceBinary
| full path
+
|full path
| no
+
|no
| /bin/nice
+
|/bin/nice
| If the nice program on the remote server is located in non-standard location, set it here.
+
|If the nice program on the remote server is located in non-standard location, set it here.
 
|-
 
|-
| localRsyncBinary  
+
|localRsyncBinary
| full path
+
|full path
| no
+
|no
| /usr/bin/rsync
+
|/usr/bin/rsync
| If the local rsync program is located in non-standard location, set it here
+
|If the local rsync program is located in non-standard location, set it here
 
|-
 
|-
| localNiceBinary  
+
|localNiceBinary
| full path
+
|full path
| no
+
|no
| /bin/nice
+
|/bin/nice
| If the nice local program is located in non-standard location, set it here.
+
|If the nice local program is located in non-standard location, set it here.
 
|-
 
|-
| RemoteAuthorizedKeysFile  
+
|RemoteAuthorizedKeysFile
| path relative to remote user's home or full path
+
|path relative to remote user's home or full path
| no
+
|no
| .ssh/authorized_keys2
+
|.ssh/authorized_keys2
| If the remote host stores the authorized keys file in a non-standard location, set it here.
+
|If the remote host stores the authorized keys file in a non-standard location, set it here.
 
|-
 
|-
| rsyncdMode
+
|rsyncdMode
| yes ''or'' no
+
|yes ''or'' no
| no
+
|no
| no
+
|no
| Set to yes to connect to the rsync daemon on the remote host (instead of running rsync over ssh).
+
|Set to yes to connect to the rsync daemon on the remote host (instead of running rsync over ssh).
 
|-
 
|-
| rsyncdModule
+
|rsyncdModule
| string
+
|string
| no
+
|no
| AFFA
+
|AFFA
| The rsyncd module name (only applicable with rsyncdMode=yes).
+
|The rsyncd module name (only applicable with rsyncdMode=yes).
 
|-
 
|-
| rsyncdUser
+
|rsyncdUser
| string
+
|string
| no
+
|no
| affa
+
|affa
| The username for authentication to the rsync daemon (only applicable with rsyncdMode=yes).
+
|The username for authentication to the rsync daemon (only applicable with rsyncdMode=yes).
 
|-
 
|-
| rsyncdPassword
+
|rsyncdPassword
| string
+
|string
| no
+
|no
| <none>
+
|<none>
| The password for authentication to the rsync daemon (only applicable with rsyncdMode=yes).
+
|The password for authentication to the rsync daemon (only applicable with rsyncdMode=yes).
    
|-
 
|-
| globalStatus
+
|globalStatus
| enabled ''or'' disabled ''or'' jobs
+
|enabled ''or'' disabled ''or'' jobs
| no
+
|no
| jobs
+
|jobs
| Set to enabled or disabled to overide the status settings in all job sections. When set to value jobs, the status settings in the job sections are effictive.<br>'''Note:''' This property is allowed only in the [GlobalAffaConfig] section.  
+
|Set to enabled or disabled to overide the status settings in all job sections. When set to value jobs, the status settings in the job sections are effictive.<br>'''Note:''' This property is allowed only in the [GlobalAffaConfig] section.
 
|-
 
|-
| sendStatus
+
|sendStatus
| daily ''or'' weekly ''or'' monthly ''or'' never
+
|daily ''or'' weekly ''or'' monthly ''or'' never
| no
+
|no
| weekly
+
|weekly
| Defines how frequently the status will be sent.<br>'''Note:''' This property is allowed only in the [GlobalAffaConfig] section.  
+
|Defines how frequently the status will be sent.<br>'''Note:''' This property is allowed only in the [GlobalAffaConfig] section.
 
|-
 
|-
| SMEServer
+
|SMEServer
| yes ''or'' no
+
|yes ''or'' no
| no
+
|no
| no
+
|no
| When set to yes, the default e-smith directories are automatically included and the property RPMCheck=yes can be used.<br>'''Note:''' this property is not implemented in Affa 3 for CentOS. It has been specifically added to the fork for SME.
+
|When set to yes, the default e-smith directories are automatically included and the property RPMCheck=yes can be used.<br>'''Note:''' this property is not implemented in Affa 3 for CentOS. It has been specifically added to the fork for SME.
 
|-
 
|-
| RPMCheck
+
|RPMCheck
| yes ''or'' no
+
|yes ''or'' no
| no
+
|no
| no
+
|no
| Only applicable to jobs that backup a SME server. Compares the packages installation of the source host with this affa backup host. Sends a message with diff list if not in sync. This check is useful, if you want have the option to rise the backup server to a production server from a backup.<br>'''Note:''' this property is not implemented in Affa 3 for CentOS. It has been specifically added to the fork for SME.
+
|Only applicable to jobs that backup a SME server. Compares the packages installation of the source host with this affa backup host. Sends a message with diff list if not in sync. This check is useful, if you want have the option to rise the backup server to a production server from a backup.<br>'''Note:''' this property is not implemented in Affa 3 for CentOS. It has been specifically added to the fork for SME.
 
|-
 
|-
| Watchdog
+
|Watchdog
| yes ''or'' no
+
|yes ''or'' no
| no
+
|no
| yes
+
|yes
| Only applicable to jobs that backups a SME server. When a job is started, affa installs a watchdog script on the source in /etc/cron.d/, which sends a warning message, if the next scheduled job (taken from the TimeSchedule property + 10 minutes) did not run. This guarantees, that you will be notfied even in case of a affa server outage. The watchdog script send a daily reminder message, if the error continues. The next run job replaces the watchdog script with a new trigger time.<br>'''Note:''' this property is not implemented in Affa 3 for CentOS. It has been specifically added to the fork for SME.
+
|Only applicable to jobs that backups a SME server. When a job is started, affa installs a watchdog script on the source in /etc/cron.d/, which sends a warning message, if the next scheduled job (taken from the TimeSchedule property + 10 minutes) did not run. This guarantees, that you will be notfied even in case of a affa server outage. The watchdog script send a daily reminder message, if the error continues. The next run job replaces the watchdog script with a new trigger time.<br>'''Note:''' this property is not implemented in Affa 3 for CentOS. It has been specifically added to the fork for SME.
 
|}
 
|}
   −
==== Default configuration properties ====
+
====Default configuration properties====
 
For all 'name=value' properties defaults can be set in the [GlobalAffaConfig] section which are used in all job configuration when the corresponding property is omitted. For example, when these properties are set in [GlobalAffaConfig] section, they can be omitted in the specific job configurations. This is useful, when you set up many similar jobs.  
 
For all 'name=value' properties defaults can be set in the [GlobalAffaConfig] section which are used in all job configuration when the corresponding property is omitted. For example, when these properties are set in [GlobalAffaConfig] section, they can be omitted in the specific job configurations. This is useful, when you set up many similar jobs.  
   Line 659: Line 564:  
Consequently you don't need to set this property for your individual jobs. Properties set in the job record override the defaults.
 
Consequently you don't need to set this property for your individual jobs. Properties set in the job record override the defaults.
   −
==== Properties for global Settings ====
+
====Properties for global Settings====
 
The following special properties are only applicable to the [GlobalAffaConfig] section:
 
The following special properties are only applicable to the [GlobalAffaConfig] section:
 
<ul>
 
<ul>
Line 678: Line 583:  
which enforces the the job execution through 'cronjobs' and overrides the specified values in the section for the specific job.
 
which enforces the the job execution through 'cronjobs' and overrides the specified values in the section for the specific job.
   −
=== Usage and command line options ===
+
===Usage and command line options===
 
{{Note box|Options can be abbreviated to uniqueness, e.g. --mak is equal to --make-cronjobs}}
 
{{Note box|Options can be abbreviated to uniqueness, e.g. --mak is equal to --make-cronjobs}}
 
  '''affa --run JOB'''
 
  '''affa --run JOB'''
Line 894: Line 799:  
Enables verbose logging. Overrides job and global configurations.
 
Enables verbose logging. Overrides job and global configurations.
   −
=== SME Specific usage and command line options ===
+
===SME Specific usage and command line options===
    
These commands are implemented in a fork of Affa 3 project for use with SME. They are not part of the Affa 3 for CentOS project.
 
These commands are implemented in a fork of Affa 3 project for use with SME. They are not part of the Affa 3 for CentOS project.
   −
==== SME server 'rise' function ====
+
====SME server 'rise' function====
    
{{Note box|Before trying a rise please check /var/affa/YourServer/rpms-missing.txt
 
{{Note box|Before trying a rise please check /var/affa/YourServer/rpms-missing.txt
Line 923: Line 828:  
{{Note box|The above command is not implemented in Affa 3 for CentOS. It has been specifically added to the fork for SME.}}
 
{{Note box|The above command is not implemented in Affa 3 for CentOS. It has been specifically added to the fork for SME.}}
   −
=== Example setups ===
+
===Example setups===
==== Dedicated backup server ====
+
====Dedicated backup server====
* Setup a dedicated server and install Affa 3 for SME.
+
 
* Setup a job for every server you want to backup.
+
*Setup a dedicated server and install Affa 3 for SME.
* Send the public keys to every server.
+
*Setup a job for every server you want to backup.
 +
*Send the public keys to every server.
 +
 
 
  affa --send-key JOBNAME
 
  affa --send-key JOBNAME
* Check whether password-less logins are working.
+
 
 +
*Check whether password-less logins are working.
 +
 
 
  affa --check-connections
 
  affa --check-connections
* Check whether the scheduled jobs are evenly distributed over the day.
+
 
 +
*Check whether the scheduled jobs are evenly distributed over the day.
 +
 
 
  affa --show-schedule
 
  affa --show-schedule
* Create the cron jobs.
+
 
 +
*Create the cron jobs.
 +
 
 
  affa --make-cronjobs
 
  affa --make-cronjobs
* Check the status after 24 hours.
+
 
 +
*Check the status after 24 hours.
 +
 
 
  affa --status
 
  affa --status
   −
==== Backup of single ibays ====
+
====Backup of single ibays====
 
Suppose you want to backup the ibays 'staff1' and 'staff2' on your production server with WAN IP 82.123.1.1  to an Affa server in a different location over the internet every night at 2:30am.
 
Suppose you want to backup the ibays 'staff1' and 'staff2' on your production server with WAN IP 82.123.1.1  to an Affa server in a different location over the internet every night at 2:30am.
* Log into the Affa server.
+
 
* Create a dedicated job file ''/etc/affa/ibay-staff.conf'' . Edit it and set
+
*Log into the Affa server.
 +
*Create a dedicated job file ''/etc/affa/ibay-staff.conf'' . Edit it and set
 +
 
 
  [ibay-staff]
 
  [ibay-staff]
 
  Description=Backup of ibay-staff on 82.123.1.1
 
  Description=Backup of ibay-staff on 82.123.1.1
Line 949: Line 866:  
  Include=/home/e-smith/files/ibays/staff1
 
  Include=/home/e-smith/files/ibays/staff1
 
  Include=/home/e-smith/files/ibays/staff2
 
  Include=/home/e-smith/files/ibays/staff2
* Save the configuration
+
 
* send the public key to the production server
+
*Save the configuration
 +
*send the public key to the production server
 +
 
 
  affa --send-key ibay-staff
 
  affa --send-key ibay-staff
* check next morning
+
 
 +
*check next morning
 +
 
 
  affa --list-archives ibay-staff
 
  affa --list-archives ibay-staff
 
  affa --status
 
  affa --status
 
  ls /var/affa/ibay-staff
 
  ls /var/affa/ibay-staff
   −
==== Two production servers backup each other ====
+
====Two production servers backup each other====
 
You have two sites connnected via a VPN and a SME Server running on each site. In that case you don't need a dedicated Affa backup server. Both production servers can additionally act as Affa backup servers backing up the server of the other site. Simply install Affa and configure a job that backs up the other one. You can use all Affa features except of the rise feature.
 
You have two sites connnected via a VPN and a SME Server running on each site. In that case you don't need a dedicated Affa backup server. Both production servers can additionally act as Affa backup servers backing up the server of the other site. Simply install Affa and configure a job that backs up the other one. You can use all Affa features except of the rise feature.
   Line 966: Line 887:  
Please pay attention, that you do not backup the archives back to the other site. Set the RootDir property to a path which is not included in the SME default backup list. When leaving the RootDir property to its default '/var/affa', this is guaranteed.
 
Please pay attention, that you do not backup the archives back to the other site. Set the RootDir property to a path which is not included in the SME default backup list. When leaving the RootDir property to its default '/var/affa', this is guaranteed.
   −
==== Use Affa to backup to a NFS-mounted NAS or a local attached USB drive ====
+
====Use Affa to backup to a NFS-mounted NAS or a local attached USB drive====
    
{{Note box|This chapter still needs to be checked whether it works with Affa 3 for SME.}}
 
{{Note box|This chapter still needs to be checked whether it works with Affa 3 for SME.}}
Line 972: Line 893:  
You want to backup your SME production server with hostname 'prodbox‘ and IP 10.200.48.1 on a mounted filesystem instead of setting up a dedicated Affa box.
 
You want to backup your SME production server with hostname 'prodbox‘ and IP 10.200.48.1 on a mounted filesystem instead of setting up a dedicated Affa box.
   −
===== Setup NAS =====
+
=====Setup NAS=====
 
You have a [http://www.freenas.org FreeNAS] box with IP 10.200.48.2 up and running with NFS service enabled. The disk is mounted to /mnt/affashare. You have authorized the IP address of your prodbox server to access share /mnt/affashare.
 
You have a [http://www.freenas.org FreeNAS] box with IP 10.200.48.2 up and running with NFS service enabled. The disk is mounted to /mnt/affashare. You have authorized the IP address of your prodbox server to access share /mnt/affashare.
* log into the 'prodbox' and install the NFS packages
+
 
 +
*log into the 'prodbox' and install the NFS packages
 +
 
 
  /usr/bin/yum install --enablerepo=smecontribs smeserver-nfs
 
  /usr/bin/yum install --enablerepo=smecontribs smeserver-nfs
* now enable and start the portmapper service
+
 
 +
*now enable and start the portmapper service
 +
 
 
  config setprop portmap status enabled
 
  config setprop portmap status enabled
 
  service portmap start
 
  service portmap start
   −
* mount the NFS share
+
*mount the NFS share
 +
 
 
  mkdir -p /mnt/affadevice
 
  mkdir -p /mnt/affadevice
 
  mount 10.200.48.2:/mnt/affashare /mnt/affadevice
 
  mount 10.200.48.2:/mnt/affashare /mnt/affadevice
      −
===== Alternatively setup a USB drive =====
+
=====Alternatively setup a USB drive=====
* log into the 'prodbox'  
+
 
* connect a USB hard disk to the USB Bus. Now you must determine what device the kernel has assigned to the drive. View the /var/log/message and search for ''Initializing USB Mass Storage driver''. A few lines below you'll find the name of the device. In this example it is ''sdh''. Replace ''/dev/sdh'' by ''your device'' in following instructions.
+
*log into the 'prodbox'
* use the fdisk program to create a linux partition. '''Verify that this is really the attached USB drive before you continue!'''
+
*connect a USB hard disk to the USB Bus. Now you must determine what device the kernel has assigned to the drive. View the /var/log/message and search for ''Initializing USB Mass Storage driver''. A few lines below you'll find the name of the device. In this example it is ''sdh''. Replace ''/dev/sdh'' by ''your device'' in following instructions.
 +
*use the fdisk program to create a linux partition. '''Verify that this is really the attached USB drive before you continue!'''
    
  fdisk /dev/sdh
 
  fdisk /dev/sdh
 
You'll most likely find an existing vfat dos partition, which you have to delete first. In the following we assume, that you have created a single partition ''/dev/sdh1''.
 
You'll most likely find an existing vfat dos partition, which you have to delete first. In the following we assume, that you have created a single partition ''/dev/sdh1''.
* now format the drive with an ext3 filesystem
+
 
 +
*now format the drive with an ext3 filesystem
 +
 
 
  mkfs.ext3 /dev/sdh1
 
  mkfs.ext3 /dev/sdh1
* make the mount point
+
 
 +
*make the mount point
 +
 
 
  mkdir -p /mnt/affadevice
 
  mkdir -p /mnt/affadevice
* add the following line to the /etc/fstab
+
 
 +
*add the following line to the /etc/fstab
 +
 
 
  /dev/sdh1 /mnt/affadevice ext3 defaults
 
  /dev/sdh1 /mnt/affadevice ext3 defaults
* mount the drive
+
 
 +
*mount the drive
 +
 
 
  mount /mnt/affadevice
 
  mount /mnt/affadevice
* crosscheck your work using the df command
+
 
 +
*crosscheck your work using the df command
 +
 
 
  df
 
  df
   −
===== Setup Affa =====
+
=====Setup Affa=====
 
You want to run backups on 11:30 h, 15:30 h and 19:30 h and you want to keep the last 3 scheduled backups, 7 daily, 5 weekly, 12 monthly and 1 yearly backups.
 
You want to run backups on 11:30 h, 15:30 h and 19:30 h and you want to keep the last 3 scheduled backups, 7 daily, 5 weekly, 12 monthly and 1 yearly backups.
* log into the 'prodbox' and install the Affa packages as described above.
+
 
* create/edit the conf file of the job: nano /etc/affa/prodbox.conf
+
*log into the 'prodbox' and install the Affa packages as described above.
 +
*create/edit the conf file of the job: nano /etc/affa/prodbox.conf
 +
 
 
and set:
 
and set:
 
  [prodbox]
 
  [prodbox]
Line 1,020: Line 959:  
  RootDir=/mnt/affadevice
 
  RootDir=/mnt/affadevice
 
Review the other properties and change them to your needs.
 
Review the other properties and change them to your needs.
* run the job manually
+
 
 +
*run the job manually
 +
 
 
  affa --run prodbox
 
  affa --run prodbox
   −
===== Limitations =====
+
=====Limitations=====
 
With this kind of setup you cannot use the affa rise feature, as it requires the backup archive to be located on the '''same fileystem''' as the server installation. The rise option uses hardlinks, which are not working across filesystems.
 
With this kind of setup you cannot use the affa rise feature, as it requires the backup archive to be located on the '''same fileystem''' as the server installation. The rise option uses hardlinks, which are not working across filesystems.
   −
===== Automount =====
+
=====Automount=====
 
Having the backup archives in the same filesystem is always a risk, which can be minimized by using the automount feature. Then the external filesystem is only mounted during a job run.
 
Having the backup archives in the same filesystem is always a risk, which can be minimized by using the automount feature. Then the external filesystem is only mounted during a job run.
   Line 1,042: Line 983:  
To access the archive directory, you need to mount it manually.
 
To access the archive directory, you need to mount it manually.
   −
==== Copying a AFFA USB hard drive archive to a new disk ====
+
====Copying a AFFA USB hard drive archive to a new disk====
 
Affa uses copious amounts of hard links to compress and preserve disk space for its backups. If you are in the situation where you want to copy such a disk archive to a new (bigger) disk, you need to ensure that the hard  links are copied correctly or the destination copy may became significantly bigger than the total of the source archive.
 
Affa uses copious amounts of hard links to compress and preserve disk space for its backups. If you are in the situation where you want to copy such a disk archive to a new (bigger) disk, you need to ensure that the hard  links are copied correctly or the destination copy may became significantly bigger than the total of the source archive.
    
One way to copy across file systems (i.e. two different USB disks) and preserve the hard links is as follows:
 
One way to copy across file systems (i.e. two different USB disks) and preserve the hard links is as follows:
   −
* mount both USB drives but with different mount points. e.g. /media/backup1 & /media/backup2 and then:
+
*mount both USB drives but with different mount points. e.g. /media/backup1 & /media/backup2 and then:
    
  mkdir /media/backup2/archive  
 
  mkdir /media/backup2/archive  
Line 1,055: Line 996:  
where '''archive''' is the name of the AFFA job you want to move to the other disk.
 
where '''archive''' is the name of the AFFA job you want to move to the other disk.
   −
=== Restore ===
+
===Restore===
==== Restore single files or directories ====
+
====Restore single files or directories====
    
'''Example 1:'''  It's Tuesday January 6th 2009, when user 'briedlin' asks you to restore the messages of his mailbox 'orders' he has accidentally deleted on Monday.
 
'''Example 1:'''  It's Tuesday January 6th 2009, when user 'briedlin' asks you to restore the messages of his mailbox 'orders' he has accidentally deleted on Monday.
   −
* You first must check what backup archives are available. The jobname of this server backup is 'primmail'. To get a listing of all archives run  
+
*You first must check what backup archives are available. The jobname of this server backup is 'primmail'. To get a listing of all archives run
 +
 
 
  affa --list-archives primmail
 
  affa --list-archives primmail
 
''(see the example listing in chapter [[Affa#Usage_and_command_line_options]]''
 
''(see the example listing in chapter [[Affa#Usage_and_command_line_options]]''
* Choose the daily.0 archive, which was created Monday night. Now restore the mailbox 'orders' using the rsync command.
+
 
* Now run the rsync command ''(note the trailing slash!)'' on the Affa backup server:
+
*Choose the daily.0 archive, which was created Monday night. Now restore the mailbox 'orders' using the rsync command.
 +
*Now run the rsync command ''(note the trailing slash!)'' on the Affa backup server:
 +
 
 
  export RDIR=/home/e-smith/files/users/briedlin/Maildir/.orders/  ''# this variable is used to shorten the next command line''
 
  export RDIR=/home/e-smith/files/users/briedlin/Maildir/.orders/  ''# this variable is used to shorten the next command line''
 
  rsync -av /var/affa/primmail/daily.0/$RDIR 10.204.48.1:$RDIR
 
  rsync -av /var/affa/primmail/daily.0/$RDIR 10.204.48.1:$RDIR
Line 1,077: Line 1,021:  
'''Example 2:''' A user has deleted the file orderform.pdf from ibay 'docs' on the server 10.204.48.1 and asks you to restore it.
 
'''Example 2:''' A user has deleted the file orderform.pdf from ibay 'docs' on the server 10.204.48.1 and asks you to restore it.
   −
* You have searched and found the latest version of this file in weekly archive of job 'prodserv'.
+
*You have searched and found the latest version of this file in weekly archive of job 'prodserv'.
* To copy it back to the server 10.204.48.1 run on the Affa server
+
*To copy it back to the server 10.204.48.1 run on the Affa server
 +
 
 
  export RFILE=/home/e-smith/files/ibays/docs/files/orderform.pdf  ''# this variable is used to shorten the next command line''
 
  export RFILE=/home/e-smith/files/ibays/docs/files/orderform.pdf  ''# this variable is used to shorten the next command line''
 
  rsync -av /var/affa/prodserv/weekly.1/$RFILE 10.204.48.1:$RFILE
 
  rsync -av /var/affa/prodserv/weekly.1/$RFILE 10.204.48.1:$RFILE
   −
* If the servers are configured to use a different ssh port eg 2222, then instead do:
+
*If the servers are configured to use a different ssh port eg 2222, then instead do:
 +
 
 
  export RFILE=/home/e-smith/files/ibays/docs/files/orderform.pdf  ''# this variable is used to shorten the next command line''
 
  export RFILE=/home/e-smith/files/ibays/docs/files/orderform.pdf  ''# this variable is used to shorten the next command line''
 
  rsync -av -e 'ssh -p 2222' /var/affa/prodserv/weekly.1/$RFILE 10.204.48.1:$RFILE
 
  rsync -av -e 'ssh -p 2222' /var/affa/prodserv/weekly.1/$RFILE 10.204.48.1:$RFILE
Line 1,098: Line 1,044:  
  rsync -av -e 'ssh -p 2222' "/var/affa/fileshare/daily.4/home/e-smith/files/ibays/mechfiles/files/Valve Control (Design Gr)/VALVE LIST FOR ISSUED.xls" "192.168.1.7:/home/e-smith/files/ibays/mechfiles/files/Valve\\ Control\\ \(Design\\ Gr\)/VALVE\\ LIST\\ FOR\\ ISSUED.xls"
 
  rsync -av -e 'ssh -p 2222' "/var/affa/fileshare/daily.4/home/e-smith/files/ibays/mechfiles/files/Valve Control (Design Gr)/VALVE LIST FOR ISSUED.xls" "192.168.1.7:/home/e-smith/files/ibays/mechfiles/files/Valve\\ Control\\ \(Design\\ Gr\)/VALVE\\ LIST\\ FOR\\ ISSUED.xls"
   −
==== Full restore ====
+
====Full restore====
    
{{Note box|Please for notes about rpms-missing.txt above: https://wiki.contribs.org/Affa#SME_Specific_usage_and_command_line_options}}
 
{{Note box|Please for notes about rpms-missing.txt above: https://wiki.contribs.org/Affa#SME_Specific_usage_and_command_line_options}}
Line 1,125: Line 1,071:  
{{Warning box|A full restore with --preserve-newer no and --delete yes reconstructs the server as it was at the time of the backup. That means, that all files created or server configuration changes made after the backup will be lost! }}
 
{{Warning box|A full restore with --preserve-newer no and --delete yes reconstructs the server as it was at the time of the backup. That means, that all files created or server configuration changes made after the backup will be lost! }}
   −
==== Moving a SME server installation to new hardware using the Affa rise feature or the backup-restore functions ====
+
====Moving a SME server installation to new hardware using the Affa rise feature or the backup-restore functions====
 
Please see this Howto: [[Moving SME to new Hardware]]
 
Please see this Howto: [[Moving SME to new Hardware]]
   −
==== Restore from USB drive on new server ====
+
====Restore from USB drive on new server====
    
This tip comes from http://forums.contribs.org/index.php?topic=42412.0
 
This tip comes from http://forums.contribs.org/index.php?topic=42412.0
Line 1,136: Line 1,082:  
A) On your testserver setup a job "mailbackup" identical to that on your backup server (a copy of the conf file is available into the folder of the archive, as an hidden file ''.mailbackup-setup.ini'') but set property '''RootDir''' to /var/affa and property '''status''' to disabled. Connect the USB drive and copy the archive of  the job mailbackup to /var/affa. Then run affa --rise mailbackup ARCHIVE
 
A) On your testserver setup a job "mailbackup" identical to that on your backup server (a copy of the conf file is available into the folder of the archive, as an hidden file ''.mailbackup-setup.ini'') but set property '''RootDir''' to /var/affa and property '''status''' to disabled. Connect the USB drive and copy the archive of  the job mailbackup to /var/affa. Then run affa --rise mailbackup ARCHIVE
   −
=== FAQ ===
+
===FAQ===
 
'''What files and directories are included by default?'''
 
'''What files and directories are included by default?'''
   Line 1,165: Line 1,111:  
First you need to configure port forwardings for the ssh service on your firewall. Use a non-standard port, e.g 2200->22, for your second server. Setup a job on your Affa server for each of your production servers. Set up the job property sshPort=2200 for second server.
 
First you need to configure port forwardings for the ssh service on your firewall. Use a non-standard port, e.g 2200->22, for your second server. Setup a job on your Affa server for each of your production servers. Set up the job property sshPort=2200 for second server.
   −
=== Uninstall ===
+
===Uninstall===
 
This removes the installed Affa package, all configuration data and all backup archives.
 
This removes the installed Affa package, all configuration data and all backup archives.
   Line 1,180: Line 1,126:  
  rm -rf /var/affa /var/log/affa
 
  rm -rf /var/affa /var/log/affa
   −
=== Troubleshooting ===
+
===Troubleshooting===
==== Affa stops working after prodserver was rebuild. ====  
+
====Affa stops working after prodserver was rebuild.====  
 
'''Description:'''
 
'''Description:'''
* Affa stopped working or is broken.
+
 
* When affaserver tries to make an ssh connection to prodserver it fails.
+
*Affa stopped working or is broken.
* In the /var/log/affa/''jobname''.log file you will this message: "SSH connection to ''prodserver ip'' failed. Did you send the public key".  
+
*When affaserver tries to make an ssh connection to prodserver it fails.
* Resending the keys does not solve the problem.  
+
*In the /var/log/affa/''jobname''.log file you will this message: "SSH connection to ''prodserver ip'' failed. Did you send the public key".
 +
*Resending the keys does not solve the problem.
    
'''Solution:'''
 
'''Solution:'''
* This is probably due to the key for prodserver that is stored on the affaserver no longer matches the key of prodserver.
  −
* You need remove the existing key so that the next ssh connection re-gets the keys from prodserver.
  −
* From the command line edit the /root/.ssh/known_hosts file and remove the line for prodserver. It starts with: ''prodserver ip'' ssh-rsa
     −
=== Bug report ===
+
*This is probably due to the key for prodserver that is stored on the affaserver no longer matches the key of prodserver.
 +
*You need remove the existing key so that the next ssh connection re-gets the keys from prodserver.
 +
*From the command line edit the /root/.ssh/known_hosts file and remove the line for prodserver. It starts with: ''prodserver ip'' ssh-rsa
 +
 
 +
===Bug report===
 
Affa is listed in the [http://bugs.contribs.org/enter_bug.cgi?product=SME%20Contribs&component=smeserver-affa bugtracker contribs section].
 
Affa is listed in the [http://bugs.contribs.org/enter_bug.cgi?product=SME%20Contribs&component=smeserver-affa bugtracker contribs section].
 
Please report all bugs, new feature requests and documentation issues there.
 
Please report all bugs, new feature requests and documentation issues there.
Line 1,200: Line 1,148:  
{{#bugzilla:columns=id,product,version,status,summary |sort=id |order=desc |disablecache=1|component=smeserver-affa|noresultsmessage="No open bugs found."}}
 
{{#bugzilla:columns=id,product,version,status,summary |sort=id |order=desc |disablecache=1|component=smeserver-affa|noresultsmessage="No open bugs found."}}
   −
=== Additional information ===
+
===Additional information===
 
For details of performance, changelog etc see [[:Affa:Additional information]]
 
For details of performance, changelog etc see [[:Affa:Additional information]]
   −
=== References ===
+
===References===
* Wikipedia article http://en.wikipedia.org/wiki/Rsync
+
 
* Rsync homepage http://rsync.samba.org/
+
*Wikipedia article http://en.wikipedia.org/wiki/Rsync
* Wiki article [[Moving SME to new Hardware]]
+
*Rsync homepage http://rsync.samba.org/
* Wiki article [[Backup with Affa and FreeDup]]
+
*Wiki article [[Moving SME to new Hardware]]
* Wiki article [[Rsyncd setup on a windows computer for use with Affa backup]]
+
*Wiki article [[Backup with Affa and FreeDup]]
* Wiki article [[Backup Windows Computers Using Affa]]
+
*Wiki article [[Rsyncd setup on a windows computer for use with Affa backup]]
* Wiki article [[Backup of ESXi Virtual Machines using Affa]]
+
*Wiki article [[Backup Windows Computers Using Affa]]
 +
*Wiki article [[Backup of ESXi Virtual Machines using Affa]]
    
----
 
----
 
[[Category: Contrib]]
 
[[Category: Contrib]]
 
[[Category: Backup]]
 
[[Category: Backup]]

Navigation menu