Changes

From SME Server
Jump to navigationJump to search
444 bytes added ,  05:33, 5 July 2019
Line 7: Line 7:  
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 ===
Line 63: Line 63:  
* Log files are rotated weekly, with 5 logs kept
 
* Log files are rotated weekly, with 5 logs kept
   −
<div style="text-align:left" class="mw-collapsible mw-collapsed" data-collapsetext="less &uarr;" data-expandtext="Obsolete Affa 2 instructions &darr;">
+
<div class="mw-collapsible mw-collapsed" style="text-align:left" data-expandtext="Obsolete Affa 2 instructions &darr;" data-collapsetext="less &uarr;">
    
=== Installation or Update of Affa 2 ===
 
=== Installation or Update of Affa 2 ===
Line 109: Line 109:  
Set up a second SME 7 box as your backupserver with hostname 'affabox‘ and IP 10.200.48.2.  
 
Set up a second SME 7 box as your backupserver with hostname 'affabox‘ and IP 10.200.48.2.  
   −
<ol></li><li>log into the 'affabox' and install the packages as described above.
+
<ol><li>log into the 'affabox' and install the packages as described above.
 
</li><li>copy the config helper script sample
 
</li><li>copy the config helper script sample
 
  cp /usr/lib/affa/jobconfig-sample.pl /root/prodbox-job.pl
 
  cp /usr/lib/affa/jobconfig-sample.pl /root/prodbox-job.pl
Line 115: Line 115:  
  my $jobname='prodbox';
 
  my $jobname='prodbox';
 
and
 
and
  'remoteHostName‘=>'10.200.48.1',
+
   
 +
'remoteHostName‘=>'10.200.48.1',
 +
 
 
optionally, if the remote server port is configured to e.g. 2222 then set
 
optionally, if the remote server port is configured to e.g. 2222 then set
  'sshPort'=>2222,
+
   
 +
'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)
 
</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
 
  /root/prodbox-job.pl
Line 187: Line 190:     
  yum install smeserver-affa --enablerepo=smecontribs
 
  yum install smeserver-affa --enablerepo=smecontribs
<headertabs/>
+
<headertabs />
    
The server again need to be updated.
 
The server again need to be updated.
Line 279: Line 282:  
</ul>
 
</ul>
 
Consequently the list below should reproduce the list for the unforked Affa 3 version, plus adding the properties above. For details refer to [https://www.guedel.eu/index.php/informatique/sme-server-8/affa-v3 Arnaud's website].
 
Consequently the list below should reproduce the list for the unforked Affa 3 version, plus adding the properties above. For details refer to [https://www.guedel.eu/index.php/informatique/sme-server-8/affa-v3 Arnaud's website].
{| border="1" cellpadding="3" cellspacing=0
+
{| border="1" cellspacing="0" cellpadding="3"
 
|-
 
|-
 
| '''Property''' || '''Value''' || '''Multivalue''' || '''Default''' || '''Description'''  
 
| '''Property''' || '''Value''' || '''Multivalue''' || '''Default''' || '''Description'''  
Line 305: Line 308:  
| 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 runs can be achieved by repeating the line for each run 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  
Line 653: Line 656:  
  '''affa --run JOB'''
 
  '''affa --run JOB'''
 
Starts a job run. Usually done by the cronjob.  
 
Starts a job run. Usually done by the cronjob.  
      
  '''affa --make-cronjobs'''
 
  '''affa --make-cronjobs'''
Configures the cronjobs as scheduled in the jobs records. By default this command will by executed by 'cronjobs' every 15 minutes. So you don't need to run this command manually, you can also just wait max. 15 minutes before your updates job configurations become effective.
+
Configures the cronjobs as scheduled in the jobs records. Run this command to make changes of time related properties effective i.e. TimeSchedule, killAt and resumeKilledAt properties. By default this command will by executed by 'cronjobs' every 15 minutes. So you don't need to run this command manually, you can also just wait max. 15 minutes before your updates job configurations become effective.
    
  '''affa --configcheck'''
 
  '''affa --configcheck'''
 
Checks the syntax and values in all configuration files found in /etc/affa/. Run this command after modifying the configuration. Lower/Upper case errors in property names are corrected automatically.
 
Checks the syntax and values in all configuration files found in /etc/affa/. Run this command after modifying the configuration. Lower/Upper case errors in property names are corrected automatically.
  −
'''affa --make-cronjobs'''
  −
Configures the cronjobs. Run this command to make changes of time related properties effective i.e. TimeSchedule, killAt and resumekKilledAt properties. Every 15 minutes Affa checks whether a configuration file is newer than the cronjob file and runs the make-cronjobs command if this is the case.
      
  '''affa --send-key [JOB JOB ...]'''
 
  '''affa --send-key [JOB JOB ...]'''
Line 827: Line 826:     
  '''affa --cleanup JOB'''
 
  '''affa --cleanup JOB'''
After you have lowered a keep value, e.g. scheduledKeep, then archives with a higher indices will no longer be shifted and will exist for ever. This option finds these archives and deletes them after confirmation.
+
After you have lowered a keep value, e.g. scheduledKeep, then archives with a higher indices will no longer be shifted and will exist for ever. This option finds these archives and deletes them after confirmation. When running the cleanup command on a locally attached USB drive, manually mount the USB drive BEFORE running this command. When finished, manually unmount the USB drive. This requirement may apply to some of the other commands listed here.
    
  '''affa --rename-job JOB NEWNAME'''
 
  '''affa --rename-job JOB NEWNAME'''
Line 872: Line 871:     
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 ====
    
{{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 879: Line 880:  
It may be necessary to install some of these rpms before a rise to prevent issues.
 
It may be necessary to install some of these rpms before a rise to prevent issues.
 
}}
 
}}
 +
 +
The SME server version of Affa has a unique feature restore feature enabling you to turn your Affa backup server into a replica of your server. It is an <b>extremely</b> fast way to restore your server.
    
  '''affa --rise [--all] JOB [ARCHIVE]'''
 
  '''affa --rise [--all] JOB [ARCHIVE]'''
 
Runs a full restore on the Affa server <b>(!!!)</b> of all standard files and directories from the backup ARCHIVE of job JOB. In other words: After completion, the Affa box reboots as a clone of the source server. Ensure, that the source server has been powered off before you reboot the Affa box, otherwise the network interface will not come up. This is important, when you run --rise remotely. The --rise feature only works with SME servers and should only be used on dedicated backup servers.
 
Runs a full restore on the Affa server <b>(!!!)</b> of all standard files and directories from the backup ARCHIVE of job JOB. In other words: After completion, the Affa box reboots as a clone of the source server. Ensure, that the source server has been powered off before you reboot the Affa box, otherwise the network interface will not come up. This is important, when you run --rise remotely. The --rise feature only works with SME servers and should only be used on dedicated backup servers.
   −
With option --all, all files and directories of the archive as defined by the include[] properties are restored. Files or directories with the same name on the Affa server will be overwritten and cannot be restored by a undorise. This should not be an issue on a dedicated Affa server which does not hold any other data. After a possible undorise those additional restored data must be removed manually.
+
With option --all, all files and directories of the archive as defined by the include[] properties are restored. Files or directories with the same name on the Affa server will be overwritten and cannot be restored by a --undo-rise. This should not be an issue on a dedicated Affa server which does not hold any other data. After a possible --undo-rise those additional restored data must be removed manually.
   −
Please note, that the rise process backs up the the Affa server itself before doing the restore from the archive. This backup is used by a possible undorise run to restore the Affa server. Only the standard files and directories are backed up. Data in non-standard loctions (like /opt) are untouched and will still exist after the rise run '''if they don't get overwritten by data of the backup''' (=if the backup contains /opt too e.g.).
+
Please note, that the rise process backs up the the Affa server itself before doing the restore from the archive. This backup is used by a possible --undo-rise run to restore the Affa server. Only the standard files and directories are backed up. Data in non-standard locations (like /opt) are untouched and will still exist after the rise run '''if they don't get overwritten by data of the backup''' (=if the backup contains /opt too e.g.).
    
{{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.}}
Line 973: Line 976:  
* crosscheck your work using the df command
 
* crosscheck your work using the df command
 
  df
 
  df
  −
===== 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.
  −
  −
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:
  −
  −
mkdir /media/backup2/archive
  −
cd /media/backup1/archive
  −
tar cpf - . | ( cd /media/backup2/archive && tar xpf - )
  −
  −
where '''archive''' is the name of the AFFA job you want to move to the other disk.
      
===== Setup Affa =====
 
===== Setup Affa =====
Line 1,025: Line 1,015:  
The mount point will be automatically created, if it does not exist. <br>
 
The mount point will be automatically created, if it does not exist. <br>
 
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 ====
 +
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:
 +
 +
* mount both USB drives but with different mount points. e.g. /media/backup1 & /media/backup2 and then:
 +
 +
mkdir /media/backup2/archive
 +
cd /media/backup1/archive
 +
tar cpf - . | ( cd /media/backup2/archive && tar xpf - )
 +
 +
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.
   Line 1,069: Line 1,073:     
==== 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}}
 +
 
Generally:  
 
Generally:  
 
  '''affa --full-restore [optional settings] JOB [ARCHIVE]'''
 
  '''affa --full-restore [optional settings] JOB [ARCHIVE]'''

Navigation menu