Restoring your environment (Simple)
A strong backup strategy only makes sense if it's easy to restore a consistent back up. The previous recipe should have provided insights on the right backup strategy from the answer to the question, how do you expect to backup? As a result, it's important that you always test your restore procedures to see whether they fit your business needs; here's a proposed one.
Getting ready
Both Bacula and rsync require that you install Debian again and set up the Bacula file daemon as explained in the corresponding recipes of this book. This is all you need to get prepared for restore.
For the Bacula example, we deleted a file from /var/www
, and we will restore it with Bacula. For future reference, here's the MD5 of the file we're deleting:
How to do it…
From the Storage/Director server, fire up Bacula's console
sudobconsole
and callrestore
.You have several options to restore, and all of them will use the catalog to find the matching job and pool to restore from. We will choose option 5—most recent backup for the client web01-fd.
Bacula will match a recent
JobId
and will put you in the selection mode where you can choose which file(s) to restore. We browse tovar/www
and markinstall.log
, type done, and hit yes.Now we can find
install.log
in/bacula-restores
and move it back to/var/www
if we decide to do so.Using rsync, you just need to oppose the argument to restures. Now the backup server comes first. This is to be executed from the client machine:
rsync –avzuser@backup:/var/backups/webapp/* /var/www rsync –avzuser@backup:/var/backups/mysql /var/lib