Everybody knows that backup is important and having a backup setup on an external resource as remote server or tape drive is even better.
I wanted to set up an automatic backup that does not require a lot of intervention, to safeguard the most important data hosted on my servers: the owncloud storage space and the wordpress storage space (this blog).
Because the data to be protected is changed continuously from day-to-day the requirements were very enterprise like:
– take daily snapshots
– try to keep history data as much as possible.
STEP 0: Desired Backup scenario
After some planning and looking at several back-up solutions I agreed that “Yosemite Server Backup Basic 10.3.00” that comes as the default software suite with my HP LTO4 tape drive has a template that is able to do that. I am going to use the following template for the back-up scenario:
1. A pool of 4 virtual tapes. At minimum there are 4 physical tapes but a virtual tape can consist of several physical tapes when the tape space is needed.
2. Each week on Friday execute a full backup at 23:00:00 (one virtual tape per week). There are 4 week
3. Each working day of the week execute an incremental backup at 23:00:00.
4. The only human intervention is: change the tape every Friday before 23:00:00. Change the tape if a physical tape is full and a job is not finished. In this case for example the virtual tape 3 will have two physical tapes 3, and 3:1
STEP 1: Install Yosemite Server Backup
To install Yosemite Server Backup follow the following tutorial: YSB Install Guide
STEP 2: Create the backup job
From the command line start the Yosemite Admin tool installed on server to which the tape drive is connected
Create a new “Backup Job”. In my case is under the name “OwnCloud”
STEP 3: Select resources to be backed up
Under the “Selection” menu select the resources to be added to the back-up. Notice that there are two servers added nas1 and nas2. The Yosemite Server Backup Basic version allows only local resources to be selected (the install is both a server add a client), or NFS mounts. The professional version allows other remote resources to be selected. In that case a client has to be deployed on all the servers where resources need to be backed and connect that client instance to a main server deploy that is linked to the tape drive.
STEP 4: Select the backup device
Under the “Device” menu select the backup device to be used. Note that there are various possible target devices. We are going to select the local connected rape device.
STEP 5: Activate encryption
A nice feature of HP LTO-4 tape drives is that they introduce support for hardware encryption. Because I want to keep the data safe I enable encryption and also check the hardware encryption box. In this case the encryption algorithm used is the one embedded in the HP LTO-4 tape drive.
Check also hardware compression if supported by the tape drive as is the case for the HP LTO-4.
STEP 6: Schedule the backup job
Under the “Configuration” menu we can use several predefined templates to schedule the backup job. I chose the Week template that matches exactly the desired scenario.
STEP 7: Advanced options
Under the “Advanced” menu several other configurations can be changed.
See submenu “Other” for some general options.
See submenu “Log Options” to configure the logging.
STEP 8: Create the restore job
In the home screen create a new job of type “Restore Job” under the name “Restore OwnCloud”
Then under the “Selection” menu select where to restore from tape. In our case the actual location of the original data is selected. In this case a restore job will overwrite the location with the data from the tape.
STEP 9: Select the restore device
The same as in the case of the backup job select the local tape drive as the restore device.
STEP 9: Manually execute jobs
At any point a job can be triggered manually from the admin console of Yosemite Server Backup by going from the home screen to the “Status and Logs” menu, selecting the job and pressing the run button.
In the case of the backup job the scheduler will take care of triggering the job but sometimes due to errors (tape drive was unavailable, tape error etc.) we may need to do it by hand.
In case of the restore job, we always have to trigger it by hand.
STEP 10: Monitoring jobs
The admin console can be used also to monitor a running job. At any point by going from the home screen to the “Status and Logs” menu and selecting the running job
we can see a lot of status information about the job.