Line 19: |
Line 19: |
| | | |
| Affa is a command line tool for system administrators and is intentionally designed without a GUI. Therefore it can be efficiently managed on the console and over slow internet connections. | | Affa is a command line tool for system administrators and is intentionally designed without a GUI. Therefore it can be efficiently managed on the console and over slow internet connections. |
| + | |
| + | '''Note:''' This documents refers to the Affa Version 2 Release Candidate. Latest stable version 1 documentation can be found [http://wiki.contribs.org/index.php?title=Affa&oldid=11974 here]. |
| | | |
| ==== Affa features at a glance ==== | | ==== Affa features at a glance ==== |
Line 27: |
Line 29: |
| * Keeps a configurable number of scheduled, daily, weekly, monthly and yearly full backup archives | | * Keeps a configurable number of scheduled, daily, weekly, monthly and yearly full backup archives |
| * The archives are browseable. No need to unpack them first. | | * 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 | | * Backup jobs are started by the cron daemon |
| * Interrupted jobs continuing with already transfered data when restarted | | * Interrupted jobs continuing with already transfered data when restarted |
Line 33: |
Line 36: |
| * Directories and files can be excluded from the backup | | * 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 | | * 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 | | * 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) | | * Optional run of custom programs before and after a job run (e.g. running tape backup) |
Line 39: |
Line 43: |
| * Sends failure messages to a configurable list of email addresses | | * Sends failure messages to a configurable list of email addresses |
| * Sends a warning message, if the backup server runs out of disk space | | * 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 | + | * 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 | + | * Watchdog sends warning, if an expected backup did not run (SME Server only) |
− | * Watchdog sends a daily reminder message, if the error continues unchecked | + | * 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 | | * 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 | | * Status can be mailed on a daily, weekly or monthly schedule |
− | * Option to display all existing archives of a job shown date, size, nbr of files and disk usage | + | * 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 only) | + | * 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. For SME 7 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 | | * 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 | | * Rise option can be run remotely as the NIC driver configuration of the backup server are preserved |
Line 54: |
Line 58: |
| * Logs to /var/log/affa/JOB.log and /var/log/affa/affa.log with optional debug switch for higher verbosity | | * 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 | | * Log files are rotated weekly, with 5 logs kept |
| + | |
| | | |
| === Installation or Update === | | === Installation or Update === |
− | /usr/bin/yum install --enablerepo=smecontribs smeserver-affa | + | wget <nowiki>http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/Affa2/smeserver-affa-2.0.0-rc1.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 --ena=smecontribs localinstall smeserver-affa-2.0.0-rc1.noarch.rpm perl-Compress-Bzip2-2.09-1.2.el4.rf.i386.rpm |
| + | |
| When you have installed Affa for the first time run the following command to initialize the Affa database | | When you have installed Affa for the first time run the following command to initialize the Affa database |
| affa --make-cronjobs | | affa --make-cronjobs |
| and logout and re-login to the console to take the bash auto-completion (TAB key) in effect. | | and logout and re-login to the console to take the bash auto-completion (TAB key) in effect. |
− |
| |
− | {{Note box|After upgrade from Affa versions <nowiki><=0.7.0</nowiki> you need to run the command
| |
− | affa --send-key
| |
− | (w/o any arguments) to generate the ssh known host entries.}}
| |
| | | |
| === Quick start example === | | === Quick start example === |
Line 126: |
Line 130: |
| | text string || || | | | text string || || |
| |- | | |- |
− | | scheduledKeep<br>dailyKeep<br>weeklyKeep<br>monthlyKeep<br>yearlyKeep | + | | scheduledKeep |
− | | integer >= 1 || 2<br>7<br>4<br>12<br>2<br>|| how many of the scheduled, daily, weekly, monthly or yearly backups should be kept | + | | integer >= 1 || 1|| how many of the scheduled backups should be kept |
| + | |- |
| + | | dailyKeep<br>weeklyKeep<br>monthlyKeep<br>yearlyKeep |
| + | | integer >= 0 || 7<br>4<br>12<br>2<br>|| how many of the daily, weekly, monthly or yearly backups should be kept |
| |- | | |- |
| | SMEServer | | | SMEServer |
Line 172: |
Line 179: |
| | EmailAddresses | | | EmailAddresses |
| | name@domain.com,name@domain.com,... || admin|| 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). | | | name@domain.com,name@domain.com,... || admin|| 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 |
| + | | integer >= 0 || 1 || when set to a value>0, Affa re-run a failed job RetryAttempts times with a delay of RetryAfter seconds. |
| + | |- |
| + | | RetryAfter |
| + | | seconds >= 3 || 600 || when set to a value>0, wait RetryAfter seconds before re-running the job after an error. Only applicable with RetryAttempts>0 |
| + | |- |
| + | | RetryNotification |
| + | | yes ''or'' no || yes || 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 send when the last attempt has failed. |
| |- | | |- |
| | chattyOnSuccess | | | chattyOnSuccess |
Line 190: |
Line 206: |
| | RootDir | | | RootDir |
| | full path || /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 | | | full path || /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 |
| + | |- |
| + | | SambaShare |
| + | | yes ''or'' no|| yes || Access to the job archives via SMB |
| |- | | |- |
| | Debug | | | Debug |
Line 202: |
Line 221: |
| | rsync--modify-window | | | rsync--modify-window |
| | integer >= 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 source and the Affa server in sync. | | | integer >= 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 source and the Affa server in sync. |
| + | |- |
| + | | rsyncOptions |
| + | | string || || addtional option string to be passed to rsync |
| |- | | |- |
| | rsyncdMode | | | rsyncdMode |
Line 217: |
Line 239: |
| | remoteOS | | | remoteOS |
| | cygwin || || with remoteOS=cygwin the options --send-key and --revoke-key uses the account 'Administrator' and the correct path for the public key on a Windows/Cygwin remote host. | | | cygwin || || with remoteOS=cygwin the options --send-key and --revoke-key uses the account 'Administrator' and the correct path for the public key on a Windows/Cygwin remote host. |
| + | |- |
| + | | ESXi |
| + | | yes ''or'' no || no || enable VMware ESXi virtual machine backup mode<br>See [[Backup of ESXi Virtual Machines using Affa]] |
| + | |- |
| + | | ESXiVMName |
| + | | string || || The name of the VM as displayed in the VI Client |
| + | |- |
| + | | ESXiUsername |
| + | | string || || The name of the VI client with permission to created an delete snapshots |
| + | |- |
| + | | ESXiPassword |
| + | | string || || The password of the user ESXiUsername |
| + | |- |
| + | | chunkFiles |
| + | | string || || Filenames that Affa should chunk and compress. Multiple file names are to be separated by the slash (/) character, e.g. 'mysql.dump/pgsql.dump' chunks the two files mysql.dump and pgsql.dump. With ESXi=yes it is implicitly set to '*.vmdk'. See also command line options --chunk-archive and --unchunk-archive |
| |} | | |} |
| | | |
| ==== Default configuration properties ==== | | ==== Default configuration properties ==== |
| All properties can be set as defaults in the DefaultAffaConfig record. This is useful, when you set up many similar jobs. | | All properties can be set as defaults in the DefaultAffaConfig record. This is useful, when you set up many similar jobs. |
| + | |
| Example: You want to set the property 'localNice' to 19 for all jobs. Then run | | Example: You want to set the property 'localNice' to 19 for all jobs. Then run |
| db affa setprop DefaultAffaConfig localNice 19 | | db affa setprop DefaultAffaConfig localNice 19 |
Line 226: |
Line 264: |
| Properties set in the job record overrides the defaults. | | Properties set in the job record overrides the defaults. |
| | | |
− | The special property 'sendStatus' is only applicable to the DefaultAffaConfig record. It controls the status report sent by email and can be set to the values 'none', 'daily', 'weekly' or 'monthly'. To setup a weekly status report run: | + | The special property 'sendStatus' is only applicable to the DefaultAffaConfig record. It controls the status report sent by email and can be set to the values 'none', 'daily', 'weekly' or 'monthly'. |
| + | |
| + | To setup a weekly status report run: |
| db affa setprop DefaultAffaConfig sendStatus weekly | | db affa setprop DefaultAffaConfig sendStatus weekly |
| then setup the cronjob: | | then setup the cronjob: |
Line 242: |
Line 282: |
| === 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''' |
| 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. | | Configures the cronjobs as scheduled in the jobs records. |
| | | |
− | affa --send-key JOB
| |
| | | |
− | affa --send-key --host=TARGETHOST [--port=PORT] [--remoteOS=cygwin] | + | '''affa --send-key JOB''' |
| + | '''affa --send-key --host=TARGETHOST [--port=PORT] [--remoteOS=cygwin]''' |
| This first generates the DSA key for the Affa Server, if not already done. Then it sends the public key to the host 'remoteHostName' as configured in the record of job JOB and generates the job specific ssh known host entry. | | This first generates the DSA key for the Affa Server, if not already done. Then it sends the public key to the host 'remoteHostName' as configured in the record of job JOB and generates the job specific ssh known host entry. |
| {{Note box|When initially doing this step, you will need to temporarily enable "Allow secure shell access using standard passwords" on the production server.}} | | {{Note box|When initially doing this step, you will need to temporarily enable "Allow secure shell access using standard passwords" on the production server.}} |
| {{Note box|<nowiki>By default, the --send-key option works for a SME Server as a remote server and for systems where the keys are stored in /root/.ssh/authorized_keys2 and the commands /bin/cat, /bin/touch, /bin/grep and /bin/mv are available. With remoteOS=cygwin it works for a Cygwin/Windows remote server.</nowiki>}} | | {{Note box|<nowiki>By default, the --send-key option works for a SME Server as a remote server and for systems where the keys are stored in /root/.ssh/authorized_keys2 and the commands /bin/cat, /bin/touch, /bin/grep and /bin/mv are available. With remoteOS=cygwin it works for a Cygwin/Windows remote server.</nowiki>}} |
| | | |
− | affa --full-restore JOB [ARCHIVE]
| |
− | Does a full restore of the standard files and directories from the backup ARCHIVE on the remote source server as defined in the JOB record. If ARCHIVE is not given, the archive 'scheduled.0' is used as the default. The full restore reconstructs the server as it was at the time of the backup. After the restore the source host reboots.
| |
| | | |
| + | '''affa --full-restore JOB [ARCHIVE]''' |
| + | Does a full restore of the standard and additional included files and directories from the backup ARCHIVE on the remote source server as defined in the JOB record. If ARCHIVE is not given, the archive 'scheduled.0' is used as the default. The full restore reconstructs the server as it was at the time of the backup. After the restore the source host reboots. |
| | | |
− | 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 7 servers und 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 7 servers und should only be used on dedicated backup servers. |
| | | |
Line 266: |
Line 308: |
| 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. See also: [[Backup_server_config#Standard_backup_.26_restore_inclusions]] | | 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. See also: [[Backup_server_config#Standard_backup_.26_restore_inclusions]] |
| | | |
− | affa --undo-rise | + | |
| + | '''affa --undo-rise''' |
| This feature reverts a risen Affa box to a backup server. After a reboot, all configured jobs will work again. | | This feature reverts a risen Affa box to a backup server. After a reboot, all configured jobs will work again. |
| | | |
| | | |
| + | '''affa --unchunk-archive JOB ARCHIVE''' |
| + | Concatenate and uncompress all chunked files in the archive ARCHIVE of job JOB to make the archive ready for a restore. Note that the most recent archive scheduled.0 is never chunked and therfore can be restored as it is without previous unchunking. |
| | | |
− | affa --create-backup-file JOB [ARCHIVE] [--outfile=FILE] | + | |
| + | '''affa --chunk-archive JOB ARCHIVE''' |
| + | Chunk and compress all files that match the names in property chunkFiles to save disk space. The should only be used as the reversal of --unchunk-archive. Chunks are stored as bzip2 files in a directory named FILENAME.affa-chunks with 8 levels depth. |
| + | |
| + | |
| + | |
| + | '''affa --create-backup-file JOB [ARCHIVE] [--outfile=FILE]''' |
| Creates a gzipped tar archive FILE from the ARCHIVE of job JOB. During creation the MD5 checksum is calculated against which the written tar is checked. The default ARCHIVE is scheduled.0 and default the FILE is ./smeserver.tgz. The checksum is written to FILE.md5sum. | | Creates a gzipped tar archive FILE from the ARCHIVE of job JOB. During creation the MD5 checksum is calculated against which the written tar is checked. The default ARCHIVE is scheduled.0 and default the FILE is ./smeserver.tgz. The checksum is written to FILE.md5sum. |
| | | |
| A smeserver.tgz file stored on an USB disk can be used for restore during a SME Server fresh install. | | A smeserver.tgz file stored on an USB disk can be used for restore during a SME Server fresh install. |
| | | |
− | affa --list-archives [--csv] JOB
| |
− | Displays a table of all present archives of job JOB with date, number of files, size and disk usage. See chapter 'Restore' for an output example.
| |
− | With --csv, the output is in machine readable colon separared format.
| |
| | | |
− | affa --status [--csv] | + | '''affa --list-archives [--csv] JOB''' |
− | Displays a table of all configured jobs with enable status, time of last and next run, size, disk usage and the number of scheduled (s), daily (d), weekly (w), monthly (m) and yearly (y) archives. Last time shows 'failed', if a job did not run in the last 24h. For disabled jobs 'Last' always shows 'failed' after 24 h. To see the date and time of the last run of those jobs use the --list-archives option. Column 'Next' shows the time when the next run will be started, if 'Enabled' is 'yes'. Column 'Disk usage' shows the usage of the partion, where the RootDir of the job is located on. If all jobs are located in the same RootDir, identical disk usage is shown for all jobs. If RootDir is /var/affa, the usage of the SME server system partition is shown. | + | Displays a table of all present archives of job JOB with date, number of files, size and and bytes received. |
| <small><pre> | | <small><pre> |
− | Affa version 1.0.0-1 on backup.mydomain.de (10.204.48.2) | + | Affa version 2.0.0-rc1 on affa1.mydomain.de (10.204.48.2) |
− | +---------------+------+--------+-------+--------+------------+----------------+ | + | +------------------------------------------------------------------------------+ |
− | | Job | ENBL | Last | Next | Size | Disk usage | N of s,d,w,m,y | | + | | Job: primmail | |
− | +---------------+------+--------+-------+--------+------------+----------------+ | + | | Description: Mailserver Albstadt | |
− | | bookkeep | yes | 23:48 | 23:30 | 4.5GB | 616GB/47% | 2,7,4,2,0 | | + | | Directory: /var/affa/primmail/ | |
− | | crm | yes | 11:20 | 13:20 | 47MB | 616GB/47% | 7,7,4,2,0 | | + | | Hostname: 10.204.144.2 | |
− | | fespdc | yes | 09:55 | 12:45 | 40GB | 616GB/47% | 6,7,4,2,0 | | + | | Email: admin@mydomain.de | |
− | | helpdesk | yes | failed | 13:40 | 70MB | 616GB/47% | 7,7,4,2,0 | | + | +-------+-----------------------+-----------+----------------+--------+--------+ |
− | | imageserv | yes | 23:01 | 23:00 | 19GB | 616GB/47% | 2,7,4,1,0 | | + | | Run | Completion date | Exec Time | Files | Size | Recvd | |
− | | intraweb | yes | 10:32 | 13:30 | 1.4GB | 616GB/47% | 7,7,4,2,0 | | + | +-------+-----------------------+-----------+----------------+--------+--------+ |
− | | pdcaus2 | yes | 23:01 | 12:15 | 5.4GB | 616GB/47% | 2,7,4,2,0 | | + | | M 9 | Sun 2008 Mar 02 06:11 | 0h29m47s | 679010 | 80GB | 60MB | |
− | | persoff | yes | running (pid 17521) | 616GB/47% | 2,7,4,2,0 | | + | | M 8 | Sun 2008 Mar 30 06:12 | 0h26m59s | 701683 | 83GB | 48MB | |
− | | primmail | yes | 10:09 | 13:00 | 45GB | 616GB/47% | 7,7,4,2,0 | | + | | M 7 | Sun 2008 Apr 27 06:16 | 0h28m01s | 731332 | 87GB | 47MB | |
− | | rayofhope | yes | 22:32 | 22:30 | 20GB | 616GB/47% | 2,7,4,1,0 | | + | | M 6 | Sun 2008 Jun 01 06:20 | 0h27m37s | 755529 | 90GB | 50MB | |
− | | sozserv | yes | 22:30 | 22:30 | 8.0GB | 616GB/47% | 2,7,4,2,0 | | + | | M 5 | Sun 2008 Jun 29 06:24 | 0h28m39s | 800200 | 94GB | 52MB | |
− | +---------------+------+--------+-------+--------+------------+----------------+ | + | | M 4 | Sun 2008 Jul 27 06:28 | 0h29m10s | 835398 | 99GB | 59MB | |
− | | az32share | no | - | 02:20 | 234MB | 616GB/47% | 7,7,2,0,0 | | + | | M 3 | Sun 2008 Aug 31 06:34 | 0h34m53s | 869409 | 101GB | 65MB | |
− | | azpdc | no | - | 21:00 | 42GB | 616GB/47% | 2,7,1,0,0 | | + | | M 2 | Sun 2008 Sep 28 06:38 | 0h33m19s | 910889 | 106GB | 59MB | |
− | +---------------+------+--------+-------+--------+------------+----------------+ | + | | M 1 | Sun 2008 Oct 26 06:42 | 0h38m41s | 932627 | 110GB | 61MB | |
| + | | M 0 | Sun 2008 Nov 30 06:48 | 0h51m44s | 954090 | 116GB | 75MB | |
| + | +-------+-----------------------+-----------+----------------+--------+--------+ |
| + | | W 3 | Sun 2008 Dec 14 06:50 | 0h53m34s | 962267 | 118GB | 68MB | |
| + | | W 2 | Sun 2008 Dec 21 06:52 | 0h53m11s | 974914 | 120GB | 69MB | |
| + | | W 1 | Wed 2008 Dec 24 06:52 | 0h48m58s | 974536 | 120GB | 64MB | |
| + | | W 0 | Sun 2008 Dec 28 06:58 | 0h39m01s | 977003 | 120GB | 61MB | |
| + | +-------+-----------------------+-----------+----------------+--------+--------+ |
| + | | D 6 | Tue 2008 Dec 30 06:52 | 0h54m45s | 976872 | 120GB | 77MB | |
| + | | D 5 | Wed 2008 Dec 31 06:52 | 0h49m10s | 977764 | 120GB | 63MB | |
| + | | D 4 | Thu 2009 Jan 01 06:28 | 0h28m09s | 977879 | 120GB | 60MB | |
| + | | D 3 | Fri 2009 Jan 02 06:53 | 0h53m21s | 978144 | 120GB | 68MB | |
| + | | D 2 | Sat 2009 Jan 03 06:53 | 0h53m15s | 978072 | 120GB | 60MB | |
| + | | D 1 | Sun 2009 Jan 04 06:53 | 0h53m16s | 976478 | 120GB | 70MB | |
| + | | D 0 | Mon 2009 Jan 05 06:52 | 0h52m42s | 977062 | 120GB | 61MB | |
| + | +-------+-----------------------+-----------+----------------+--------+--------+ |
| + | | S 1 | Mon 2009 Jan 05 17:57 | 0h27m48s | 976353 | 120GB | 98MB | |
| + | | S 0 | Tue 2009 Jan 06 06:52 | 0h52m55s | 976539 | 120GB | 70MB | |
| + | +-------+-----------------------+-----------+----------------+--------+--------+ |
| + | </pre></small> |
| + | With --csv, the output is in machine readable colon separated format. |
| + | |
| | | |
| + | '''affa --status [--csv]''' |
| + | Displays a table of all configured jobs with enable status, time of last and next run, size of the most recent archive, exectution time of the last run and the number of scheduled (S), daily (D), weekly (W), monthly (M) and yearly (Y) archives. Last time shows 'failed', if a job did not run in the last 24h. For disabled jobs 'Last' always shows 'failed' after 24 h. To see the date and time of the last run of those jobs use the --list-archives option. Column 'Next' shows the time when the next run will be started, if 'Enabled' is 'yes'. |
| + | <small><pre> |
| + | Affa version 2.0.0-rc1 on backup.mydomain.de (10.204.48.2) |
| + | +----------------+-----+-------+-----------+-------+-------+----------------+ |
| + | | Job | ENA | Last | Exec Time | Next | Size | N of S,D,W,M,Y | |
| + | +----------------+-----+-------+-----------+-------+-------+----------------+ |
| + | | erp-alb-rsyncd | yes | 00:20 | 0h00m14s | 00:20 | 46MB | 1, 7, 4,10, 0 | |
| + | | erp-fra-rsyncd | yes | 02:46 | 0h01m03s | 02:45 | 712MB | 1, 7, 4,10, 0 | |
| + | | esxi-TS-W2K | yes | 00:37 | 4h22m08s | 20:15 | 60GB | 1, 7, 1, 0, 0 | |
| + | | esxi-W2KR2 | yes | 02:22 | 3h52m09s | 22:30 | 40GB | 1, 7, 1, 0, 0 | |
| + | | helpdesk | yes | 00:25 | 0h00m47s | 00:25 | 117MB | 1, 7, 4,10, 0 | |
| + | | imageserv | yes | running (pid 16477) | 1, 7, 4,10, 0 | |
| + | | intraweb | yes | 06:34 | 0h04m50s | 18:00 | 2.1GB | 2, 7, 4,10, 0 | |
| + | | pdcalb | yes | 21:19 | 0h14m27s | 21:05 | 89GB | 1, 7, 4,10, 0 | |
| + | | pdcfra | yes | 04:18 | 0h03m33s | 04:15 | 33GB | 1, 7, 4,10, 0 | |
| + | | primmail | yes | 06:52 | 0h52m55s | 17:30 | 120GB | 2, 7, 4,10, 0 | |
| + | | rayofhope | yes | 21:52 | 0h07m40s | 21:45 | 26GB | 1, 7, 4,10, 0 | |
| + | | smecrmpg | yes | 22:35 | 0h00m21s | 22:35 | 70MB | 1, 7, 4,10, 0 | |
| + | | sozserv | yes | 02:09 | 0h04m03s | 02:05 | 5.9GB | 1, 7, 4,10, 0 | |
| + | | wiki | yes | 03:45 | 0h00m27s | 03:45 | 278MB | 1, 7, 4, 8, 0 | |
| + | +----------------+-----+-------+-----------+-------+-------+----------------+ |
| + | | az32share | no | - | 0h00m22s | 03:05 | 1.3GB | 1, 7, 4, 8, 0 | |
| + | +----------------+-----+-------+-----------+-------+-------+----------------+ |
| </pre></small> | | </pre></small> |
| + | With --csv, the output is printed in a machine readable colon separated format. |
| + | |
| | | |
| + | '''affa --disk-usage''' |
| + | Shows the current disk usage of all root dir filesystems |
| + | <small><pre> |
| + | Affa version 2.0.0-rc1 on backup2.mydomain.de (10.204.0.52) |
| + | +------+--------+--------+----------------------------------------------------+ |
| + | | Use% | Used | Avail | Root Dir | |
| + | +------+--------+--------+----------------------------------------------------+ |
| + | | 71% | 938GB | 365GB | /var/affa | |
| + | | 20% | 194GB | 759GB | /mnt/affadev | |
| + | +------+--------+--------+----------------------------------------------------+ |
| + | </pre></small> |
| With --csv, the output is printed in a machine readable colon separated format. | | With --csv, the output is printed in a machine readable colon separated format. |
| | | |
| | | |
− | affa --show-schedule | + | '''affa --show-schedule [--all]''' |
− | Prints a 'graphical' timetable for all enabled jobs. The resolution is 30 minutes. Disabled jobs are not shown. | + | Prints a 'graphical' timetable for all enabled jobs. The resolution is 30 minutes. An 'X' character marks the scheduled start times. The last performance duration is marked with '=' characters. |
| <small><pre> | | <small><pre> |
− | Affa version 1.0.0-1 on backup.mydomain.de (10.204.48.2) | + | Affa version 2.0.0-rc1 on backup.mydomain.de (10.204.48.2) |
− | TIME 0:00 4:00 8:00 12:00 16:00 20:00
| + | TIME 0:00 4:00 8:00 12:00 16:00 20:00 |
− | crm -X------ -------- -------- -------- -------- -------- | + | erp-alb-rsyncd X------- -------- -------- -------- -------- -------- |
− | sozserv --X----- -------- -------- -------- -------- --------
| + | helpdesk X------- -------- -------- -------- -------- -------- |
− | fespdc ----X--- -------- -------- -------- -------- --------
| + | esxi-W2KR2 =====--- -------- -------- -------- -------- -----X== |
− | imageserv -----X-- -------- -------- -------- -------- --------
| + | esxi-TS-W2K ==------ -------- -------- -------- -------- X======= |
− | primmail ------X- -------- -------- -------- -------- --------
| + | imageserv ---X---- -------- -------- -------- -------- -------- |
− | intraweb -------- X------- -------- -------- -------- --------
| + | sozserv ----X--- -------- -------- -------- -------- -------- |
− | bookkeep -------- ------X- X-X-X-X- X-X-X-X- X-X-X-X- X-X-X---
| + | erp-fra-rsyncd -----X-- -------- -------- -------- -------- -------- |
− | pdcaus2 -------- -------- -------- X------- -------- ------X-
| + | wiki -------X -------- -------- -------- -------- -------- |
− | persoff -------- -------- -------- -------- -------- ---X----
| + | pdcfra -------- X------- -------- -------- -------- -------- |
− | helpdesk -------- -------- -------- -------- -------- -----X--
| + | primmail -------- ----X=-- -------- -------- ---X---- -------- |
− | rayofhope -------- -------- -------- -------- -------- -----X--
| + | intraweb -------- -----X-- -------- -------- ----X--- -------- |
− | 2 disabled jobs not listed
| + | pdcalb -------- -------- -------- -------- -------- --X----- |
| + | rayofhope -------- -------- -------- -------- -------- ---X---- |
| + | smecrmpg -------- -------- -------- -------- -------- -----X-- |
| + | 1 disabled jobs not listed. Use --all to display. |
| </pre></small> | | </pre></small> |
| | | |
| | | |
− | affa --send-status | + | '''affa --send-status''' |
− | Sends the status table to the email adresses configured in the 'DefaultAffaConfig' record. Used by the cronjob 'affa-status'. | + | Sends the status table, the disk-usage and the archive list of all jobs to the email addresses configured in the 'DefaultAffaConfig' record. Used by the cronjob 'affa-status'. |
| | | |
− | affa --mailtest JOB | + | |
− | Sends a test email to the email adresses configured in the JOB record. With property Watchdog=yes, a test email is sent from the remote host, too. Use this to verify, that your mail processing is functional.<br> | + | '''affa --mailtest JOB''' |
| + | Sends a test email to the email addresses configured in the JOB record. With property Watchdog=yes, a test email is sent from the remote host, too. Use this to verify, that your mail processing is functional.<br> |
| '''Note:''' By default Affa only sends messages on errors, never on success (see property chattyOnSuccess). | | '''Note:''' By default Affa only sends messages on errors, never on success (see property chattyOnSuccess). |
| | | |
− | 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 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. |
| | | |
− | affa --rename-job JOB NEWNAME | + | |
| + | '''affa --rename-job JOB NEWNAME''' |
| Renames the job JOB to NEWNAME including all database records and archive directories. | | Renames the job JOB to NEWNAME including all database records and archive directories. |
| | | |
− | affa --move-archive JOB NEWROOTDIR | + | |
| + | '''affa --move-archive JOB NEWROOTDIR''' |
| Moves the archive directory of job JOB to the rootdir NEWROOTDIR and adjusts the property RootDir. NEWROOTDIR must be a full path starting with a slash. As moving across filesystems (e.g. from an external USB drive to the local disk) is not possible, Affa uses a copy command in this case and deletes the source directory after that. Depending on the archive size, copying across filesystems can take a long time. | | Moves the archive directory of job JOB to the rootdir NEWROOTDIR and adjusts the property RootDir. NEWROOTDIR must be a full path starting with a slash. As moving across filesystems (e.g. from an external USB drive to the local disk) is not possible, Affa uses a copy command in this case and deletes the source directory after that. Depending on the archive size, copying across filesystems can take a long time. |
| | | |
− | affa --delete-job [--revoke-key] JOB | + | |
| + | '''affa --delete-job [--revoke-key] JOB''' |
| Irreversibly deletes a job including all archives, configuration and report databases. With given --revoke-key option, the public key on the remote server will be deleted. | | Irreversibly deletes a job including all archives, configuration and report databases. With given --revoke-key option, the public key on the remote server will be deleted. |
| | | |
− | affa --revoke-key JOB
| |
| | | |
− | affa --revoke-key --host=TARGETHOST [--port=PORT] [--remoteOS=cygwin] | + | '''affa --revoke-key JOB''' |
| + | '''affa --revoke-key --host=TARGETHOST [--port=PORT] [--remoteOS=cygwin]''' |
| Deletes the public dsa key on the remote server. | | Deletes the public dsa key on the remote server. |
| {{Note box|<nowiki>By default, the --send-key option works for a SME Server as a remote server and for systems where the keys are stored in /root/.ssh/authorized_keys2. With remoteOS=cygwin it works for a Cygwin/Windows remote server.</nowiki>}} | | {{Note box|<nowiki>By default, the --send-key option works for a SME Server as a remote server and for systems where the keys are stored in /root/.ssh/authorized_keys2. With remoteOS=cygwin it works for a Cygwin/Windows remote server.</nowiki>}} |
| | | |
− | affa --check-connections | + | |
| + | '''affa --check-connections''' |
| Checks the ssh login for all configured jobs. For jobs where the public key was not yet sent, you are prompted for the password and the key will be sent then. | | Checks the ssh login for all configured jobs. For jobs where the public key was not yet sent, you are prompted for the password and the key will be sent then. |
| | | |
− | affa --kill JOB | + | |
| + | '''affa --kill JOB''' |
| Terminates the running job JOB and all its child processes (rsync processes). | | Terminates the running job JOB and all its child processes (rsync processes). |
| + | |
| + | '''affa --debug''' |
| + | Enables verbose logging. Overrides job and global configurations. |
| | | |
| === Example setups === | | === Example setups === |
Line 374: |
Line 493: |
| | | |
| | | |
− | ==== Backup 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. |
− | <ol></li><li>log into the Affa server and install the packages as described above.
| + | * log into the Affa server and install the packages as described above. |
− | </li><li>copy the config helper script sample
| + | * copy the config helper script sample |
| cp /usr/lib/affa/jobconfig-sample.pl /root/ibay-staff-job.pl | | cp /usr/lib/affa/jobconfig-sample.pl /root/ibay-staff-job.pl |
− | </li><li>edit /root/ibay-staff-job.pl and set
| + | * edit /root/ibay-staff-job.pl and set |
| my $jobname='ibay-staff'; | | my $jobname='ibay-staff'; |
| and | | and |
Line 387: |
Line 506: |
| 'Include[0]'=>'/home/e-smith/files/ibays/staff1', | | 'Include[0]'=>'/home/e-smith/files/ibays/staff1', |
| 'Include[1]'=>'/home/e-smith/files/ibays/staff2', | | 'Include[1]'=>'/home/e-smith/files/ibays/staff2', |
− | </li><li>write the configuration
| + | * write the configuration |
| /root/ibay-staff-job.pl | | /root/ibay-staff-job.pl |
− | </li><li>send the public key to the production server
| + | * send the public key to the production server |
| affa --send-key ibay-staff | | affa --send-key ibay-staff |
− | </li><li>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 |
− | </li></ol>
| |
| | | |
| ==== Two production servers backup each other ==== | | ==== Two production servers backup each other ==== |
Line 416: |
Line 534: |
| ===== Affa Rsyncd mode setup (Quick start example) ===== | | ===== Affa Rsyncd mode setup (Quick start example) ===== |
| You want to backup the ''My Documents'' folders of the users ''ssorglos'' and ''bsimpson'' from the Windows computer 'ws001' with IP 192.168.1.65 to your Affa server 'affabox' with IP 192.168.1.3. | | You want to backup the ''My Documents'' folders of the users ''ssorglos'' and ''bsimpson'' from the Windows computer 'ws001' with IP 192.168.1.65 to your Affa server 'affabox' with IP 192.168.1.3. |
− | | + | * log into the 'affabox' and copy the Cygwin config helper script sample |
− | 1. log into the 'affabox' and copy the Cygwin config helper script sample
| |
| cp /usr/lib/affa/jobconfig-cygwin-sample.pl /root/ws001-mydocs-job.pl | | cp /usr/lib/affa/jobconfig-cygwin-sample.pl /root/ws001-mydocs-job.pl |
− | 2. edit /root/ws001-mydocs-job.pl and set
| + | * edit /root/ws001-mydocs-job.pl and set |
| my $jobname='ws001-mydocs'; | | my $jobname='ws001-mydocs'; |
| and | | and |
Line 427: |
Line 544: |
| 'Include[1]'=>'/c/Documents and Settings/bsimpson/My Documents/', | | 'Include[1]'=>'/c/Documents and Settings/bsimpson/My Documents/', |
| where ''secretword'' must be replaced by the password you have chosen in the rsyncd.secretsfile on the Windows box. | | where ''secretword'' must be replaced by the password you have chosen in the rsyncd.secretsfile on the Windows box. |
− | | + | * write the configuration (this makes the database entries and sets up the cronjobs) |
− | 3. write the configuration (this makes the database entries and sets up the cronjobs)
| |
| /root/ws001-mydocs-job.pl | | /root/ws001-mydocs-job.pl |
− | 4. run the job manually. After completion check the archive /var/affa/ws001-mydocs/scheduled.0 and the logfile /var/log/affa/ws001-mydocs.log
| + | * run the job manually. After completion check the archive /var/affa/ws001-mydocs/scheduled.0 and the logfile /var/log/affa/ws001-mydocs.log |
| affa --run ws001-mydocs | | affa --run ws001-mydocs |
| | | |
Line 452: |
Line 568: |
| ===== 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. |
− | <ol></li><li>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 |
| | | |
− | </li><li>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 |
− | </li></ol>
| + | |
| | | |
| ===== Alternatively setup a USB drive ===== | | ===== Alternatively setup a USB drive ===== |
− | <ol></li><li>log into the 'prodbox'
| + | * log into the 'prodbox' |
− | </li><li>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.
| + | * 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. |
− | </li><li>Use the fdisk program to create a linux partition. '''Verify that this is really the attached USB drive before you continue!'''
| + | * 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''. |
− | </li><li>Now format the drive with an ext3 filesystem
| + | * now format the drive with an ext3 filesystem |
| mkfs.ext3 /dev/sdh1 | | mkfs.ext3 /dev/sdh1 |
− | </li><li>Make the mount point
| + | * make the mount point |
| mkdir -p /mnt/affadevice | | mkdir -p /mnt/affadevice |
− | </li><li>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 |
− | </li><li>Mount the drive
| + | * mount the drive |
| mount /mnt/affadevice | | mount /mnt/affadevice |
− | </li><li>Crosscheck your work using the df command
| + | * crosscheck your work using the df command |
| df | | df |
− | </li></ol>
| + | |
| | | |
| ===== 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. |
− | <ol></li><li>log into the 'prodbox' and install the Affa packages as described above.
| + | * log into the 'prodbox' and install the Affa packages as described above. |
− | </li><li>copy the config helper script sample
| + | * 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 |
− | </li><li>edit /root/prodbox-job.pl and set
| + | * edit /root/prodbox-job.pl and set |
| my $jobname='prodbox'; | | my $jobname='prodbox'; |
| and | | and |
Line 499: |
Line 615: |
| '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. |
− | </li><li>write the configuration
| + | * write the configuration |
| /root/prodbox-job.pl | | /root/prodbox-job.pl |
− | </li><li>run the job manually
| + | * run the job manually |
| | | |
| affa --run prodbox | | affa --run prodbox |
− | </li></ol>
| + | |
| | | |
| ===== 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 ===== |
Line 523: |
Line 639: |
| | | |
| 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> |
− | For access to the archive directory, you need to mount it manually.
| + | To access the archive directory, you need to mount it manually. |
| | | |
| === Restore === | | === Restore === |
| ==== Restore single files or directories ==== | | ==== Restore single files or directories ==== |
− | <b>Example 1:</b> It's Tuesday April 8th 2008, when user 'briedlin' asks you to restore the messages of his mailbox 'orders' he has inadvertently deleted on Monday morning.
| + | '''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. |
| | | |
− | <ol></li><li>You first must check what backup archives are available. The jobname of this server backup is 'prodserv'.
| + | * 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 |
− | On the Affa backup server do:
| + | affa --list-archives primmail |
− | affa --list-archives prodserv | + | ''(see the example listing in chapter [[Affa#Usage_and_command_line_options]]'' |
− | <small><pre>
| + | * Choose the daily.0 archive, which was created Monday night. Now restore the mailbox 'orders' using the rsync command. |
− | Affa version 1.0.0-1 on affa1.mydomain.de (10.204.48.2)
| + | * 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'' |
− | | Job: prodserv |
| + | rsync -av /var/affa/primmail/daily.0/$RDIR 10.204.48.1:$RDIR |
− | | Description: File- and Mailserver Alfdorf |
| |
− | | Directory: /var/affa/prodserv/ |
| |
− | | Hostname: 10.204.48.1 |
| |
− | | Email: sysadmin@mydomain.de |
| |
− | +-----------------------+----------------+--------------+--------+-------------+
| |
− | | Date | Archive | Files | Size | Disk usage |
| |
− | +-----------------------+----------------+--------------+--------+-------------+
| |
− | | Sat 2007 Apr 28 00:45 | monthly.10 | 39625 | 7.7GB | 118GB/9% |
| |
− | | Sat 2007 May 26 00:41 | monthly.9 | 39928 | 7.8GB | 88GB/6% |
| |
− | | Sat 2007 Jun 30 00:41 | monthly.8 | 40343 | 7.8GB | 155GB/11% |
| |
− | | Fri 2007 Jul 27 00:41 | monthly.7 | 39530 | 7.9GB | 172GB/13% |
| |
− | | Sat 2007 Aug 25 00:41 | monthly.6 | 39613 | 7.9GB | 179GB/13% |
| |
− | | Sat 2007 Sep 29 00:42 | monthly.5 | 40157 | 8.2GB | 198GB/15% |
| |
− | | Sat 2007 Oct 27 00:46 | monthly.4 | 40453 | 7.6GB | 213GB/16% |
| |
− | | Sat 2007 Dec 01 00:43 | monthly.3 | 40545 | 7.6GB | 228GB/17% |
| |
− | | Sun 2007 Dec 30 00:42 | monthly.2 | 40378 | 7.6GB | 284GB/21% |
| |
− | | Sun 2008 Jan 27 00:44 | monthly.1 | 40545 | 7.5GB | 422GB/32% |
| |
− | | Sun 2008 Mar 02 00:42 | monthly.0 | 40924 | 7.7GB | 479GB/36% |
| |
− | +-----------------------+----------------+--------------+--------+-------------+
| |
− | | Sun 2008 Mar 09 00:41 | weekly.3 | 40976 | 7.7GB | 501GB/38% |
| |
− | | Sun 2008 Mar 16 00:42 | weekly.2 | 41027 | 7.7GB | 506GB/38% |
| |
− | | Sun 2008 Mar 23 00:41 | weekly.1 | 41051 | 7.7GB | 500GB/38% |
| |
− | | Sun 2008 Mar 30 00:41 | weekly.0 | 41062 | 7.7GB | 503GB/38% |
| |
− | +-----------------------+----------------+--------------+--------+-------------+
| |
− | | Tue 2008 Apr 01 00:58 | daily.6 | 41090 | 7.7GB | 500GB/38% |
| |
− | | Wed 2008 Apr 02 00:43 | daily.5 | 47680 | 7.8GB | 501GB/38% |
| |
− | | Thu 2008 Apr 03 00:46 | daily.4 | 47680 | 7.8GB | 507GB/38% |
| |
− | | Fri 2008 Apr 04 00:42 | daily.3 | 47686 | 7.8GB | 513GB/39% |
| |
− | | Sat 2008 Apr 05 00:45 | daily.2 | 47687 | 7.8GB | 512GB/39% |
| |
− | | Sun 2008 Apr 06 00:42 | daily.1 | 47687 | 7.8GB | 511GB/39% |
| |
− | | Mon 2008 Apr 07 00:42 | daily.0 | 47687 | 7.8GB | 511GB/39% |
| |
− | +-----------------------+----------------+--------------+--------+-------------+
| |
− | | Tue 2008 Apr 08 00:43 | scheduled.0 | 47688 | 7.8GB | 525GB/40% |
| |
− | +-----------------------+----------------+--------------+--------+-------------+
| |
| | | |
− | </pre></small>
| + | If the servers are configured to use a different ssh port eg 2222, then instead do: |
− | | |
− | </li><li>Choose the daily.0 archive, which was created Monday night. Now restore the mailbox 'orders' using the rsync command.
| |
− | </li><li>Now run the rsync command ''(note the trailing slash!)'' on the Affa backup server:
| |
− | export RDIR=/home/e-smith/files/users/briedlin/Maildir/.orders/
| |
− |
| |
− | rsync -av /var/affa/prodserv/daily.0/$RDIR 10.204.48.1:$RDIR
| |
| | | |
− | </li>If the servers are configured to use a different ssh port eg 2222, then instead do:
| + | export RDIR=/home/e-smith/files/users/briedlin/Maildir/.orders/ ''# this variable is used to shorten the next command line'' |
| + | rsync -av -e 'ssh -p 2222' /var/affa/primmail/daily.0/$RDIR 10.204.48.1:$RDIR |
| | | |
− | export RDIR=/home/e-smith/files/users/briedlin/Maildir/.orders/
| |
− | rsync -av -e 'ssh -p 2222' /var/affa/prodserv/daily.0/$RDIR 10.204.48.1:$RDIR
| |
− | </li></ol>
| |
| | | |
| | | |
− | <b>Example 2:</b> A user has deleted the file orderform.pdf from ibay 'docs' 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. |
| | | |
− | <ol></li><li>You have searched and found the latest version of this file in archive weekly.
| + | * You have searched and found the latest version of this file in weekly archive of job 'prodserv'. |
− | </li><li>Copy it back to the server - On the Affa backup server do:
| + | * 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 | + | 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 |
| | | |
− | </li>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'' |
| + | rsync -av -e 'ssh -p 2222' /var/affa/prodserv/weekly.1/$RFILE 10.204.48.1:$RFILE |
| | | |
− | export RFILE=/home/e-smith/files/ibays/docs/files/orderform.pdf
| |
− | rsync -av -e 'ssh -p 2222' /var/affa/prodserv/weekly.1/$RFILE 10.204.48.1:$RFILE
| |
− | </li></ol>
| |
| | | |
| | | |
Line 613: |
Line 686: |
| To run a full restore of user and configuration data run on the Affa server | | To run a full restore of user and configuration data run on the Affa server |
| affa --full-restore <JOB> [<ARCHIVE>] | | affa --full-restore <JOB> [<ARCHIVE>] |
− | This rsyncs the data from the backup ARCHIVE back to the 'remoteHostname' defined in the configuration of the job JOB. | + | This rsyncs the data from the backup ARCHIVE back to the 'remoteHostname' defined in the configuration of the job JOB. |
| | | |
| Example: | | Example: |
Line 623: |
Line 696: |
| | | |
| {{Warning box| A full restore 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. After the restore is done, the restored server reboots automatically. }} | | {{Warning box| A full restore 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. After the restore is done, the restored server reboots automatically. }} |
− |
| |
| | | |
| ==== Moving a SME 7 server installation to new hardware using the Affa rise feature ==== | | ==== Moving a SME 7 server installation to new hardware using the Affa rise feature ==== |
Line 648: |
Line 720: |
| | | |
| | | |
− | '''Can I use Affa to backup a SME 6 server?'''<br> | + | '''Can I exclusively backup image files from a specific directory?''' |
− | To backup a SME 6 server set the property 'rsync--inplace' to 'no' and install the perl-TimeDate package on the SME 6 box. The perl-TimeDate package is needed by the watchdog script running on the SME 6. Use the RPM from DAG: [http://dag.wieers.com/rpm/packages/perl-TimeDate/perl-TimeDate-1.16-0.rh73.dag.noarch.rpm perl-TimeDate-1.16-0.rh73.dag.noarch.rpm]<br>
| + | |
− | You cannot use the RPMCheck property.
| + | Yes. Assuming you want to backup all gif and jpg files from directory /home/e-smith/files/ibays/pictures/files use this configuration |
| + | db affa setprop JOBNAME SMEServer no # do not include SME Server default directories and files |
| + | db affa setprop JOBNAME Include[0] '/home/e-smith/files/ibays/pictures/files' # start searching here |
| + | db affa setprop JOBNAME Include[1] '*/' # search the tree recursively |
| + | db affa setprop JOBNAME Include[2] '*.gif' # copy files that match these patterns |
| + | db affa setprop JOBNAME Include[3] '*.jpg' |
| + | db affa setprop JOBNAME Exclude[0] '*' # exclude all others |
| + | db affa setprop JOBNAME rsyncOptions '-m' # do not create empty folders |
| | | |
| | | |
Line 658: |
Line 737: |
| | | |
| '''How do I backup two SME servers behind a firewall?''' | | '''How do I backup two SME servers behind a firewall?''' |
− | 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 === |
Line 670: |
Line 749: |
| Remvove the Affa package | | Remvove the Affa package |
| rpm -e smeserver-affa | | rpm -e smeserver-affa |
− | and, if perl-Filesys-DiskFree is not needed by any other packages: | + | and, if these packages are not needed by any other packages: |
− | rpm -e perl-Filesys-DiskFree | + | rpm -e perl-Filesys-DiskFree perl-Compress-Bzip2 |
| Cleaning up | | Cleaning up |
| rm -f /etc/cron.d/affa /etc/cron.d/affa-status | | rm -f /etc/cron.d/affa /etc/cron.d/affa-status |
Line 691: |
Line 770: |
| * Wiki article [[Rsyncd setup on a windows computer for use with Affa backup]] | | * Wiki article [[Rsyncd setup on a windows computer for use with Affa backup]] |
| * Wiki article [[Backup Windows Computers 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]] |
| ---- | | ---- |