Line 234: |
Line 234: |
| | | |
| === Restore === | | === Restore === |
− | ==== [Todo] Restore a single files or directory ==== | + | ==== Restore single files or directories ==== |
− | ... | + | <b>Example 1:</b> It's May, 8th, when user 'briedlin' ask you to restore the messages of his mailbox 'orders' he has inadvertently deleted yesterday at 17:00 h. |
| + | |
| + | 1. You first must check what backup archives are available. The jobname of this server backup ist 'prodserv'. Run a long listing of the archives directory:<br><br><code># ls -ltr /var/affa/prodserv</code><br> |
| + | <pre> |
| + | drwxr-xr-x 5 root root 4096 Apr 5 15:59 monthly.0 |
| + | drwxr-xr-x 5 root root 4096 Apr 8 04:05 weekly.3 |
| + | drwxr-xr-x 5 root root 4096 Apr 15 04:06 weekly.2 |
| + | drwxr-xr-x 5 root root 4096 Apr 22 04:07 weekly.1 |
| + | drwxr-xr-x 5 root root 4096 Apr 29 04:07 weekly.0 |
| + | drwxr-xr-x 5 root root 4096 May 1 04:07 daily.6 |
| + | drwxr-xr-x 5 root root 4096 May 2 04:07 daily.5 |
| + | drwxr-xr-x 5 root root 4096 May 3 04:07 daily.4 |
| + | drwxr-xr-x 5 root root 4096 May 4 04:07 daily.3 |
| + | drwxr-xr-x 5 root root 4096 May 5 04:08 daily.2 |
| + | drwxr-xr-x 5 root root 4096 May 6 04:08 daily.1 |
| + | drwxr-xr-x 5 root root 4096 May 7 04:05 daily.0 |
| + | drwxr-xr-x 5 root root 4096 May 7 16:08 scheduled.6 |
| + | drwxr-xr-x 5 root root 4096 May 7 19:09 scheduled.5 |
| + | drwxr-xr-x 5 root root 4096 May 7 23:05 scheduled.4 |
| + | drwxr-xr-x 5 root root 4096 May 8 04:08 scheduled.3 |
| + | drwxr-xr-x 5 root root 4096 May 8 07:04 scheduled.2 |
| + | drwxr-xr-x 5 root root 4096 May 8 10:13 scheduled.1 |
| + | drwxr-xr-x 5 root root 4096 May 8 13:07 scheduled.0 |
| + | </pre> |
| + | 2. Choose the scheduled.6 archive, which was created an hour before the accident. Now restore the mailbox 'orders' using the rsync command. |
| + | |
| + | |
| + | 3. Get the server's IP address:<br><code># db affa getprop prodbox remoteHostName</code><br> |
| + | |
| + | <pre>10.204.48.1</pre> |
| + | |
| + | |
| + | 4. Now run the rsync command: |
| + | |
| + | <code># export RDIR=/home/e-smith/users/briedlin/Maildir/.orders/</code><br>Note the leading slash! |
| + | |
| + | <code># rsync -av --numeric-ids -e /usr/bin/ssh /var/affa/prodserv/scheduled.6/$RDIR 10.204.48.1:$RDIR</code> |
| + | |
| + | |
| + | |
| + | <b>Example 2:</b> A user has deleted the file orderform.pdf from ibay 'docs' and ask you to restore it. |
| + | |
| + | 1. You searched and found the latest version of this file in archive weekly.1 |
| + | |
| + | 2. Copy it back to the server: |
| + | |
| + | <code># export RFILE=/home/e-smith/files/ibays/docs/files/orderform.pdf</code> |
| + | |
| + | <code># scp /var/affa/prodserv/weekly.1/$RFILE 10.204.48.1:$RFILE |
| + | |
| ==== Full restore ==== | | ==== Full restore ==== |
| To run a full restore of user and configuration data run on the Affa server<br><code># affa --full-restore <JOB> [<ARCHIVE>]</code><br>This rsyncs the data from the backup ARCHIVE back to the 'remoteHostname' defined in the configuration of the job JOB. | | To run a full restore of user and configuration data run on the Affa server<br><code># affa --full-restore <JOB> [<ARCHIVE>]</code><br>This rsyncs the data from the backup ARCHIVE back to the 'remoteHostname' defined in the configuration of the job JOB. |