8. Backing Up and Restoring your Files

Abstract

Drakbackup allows you to back up data present on your computer, whether it be on hard drive, another networked computer, a CD/DVD or a tape. Once the files you wish to back up are defined and that you've configured the way to access the backup media, you can run the backup periodically. Then, you can forget about it until you wish to restore some files.

The backup parameters must be defined so that Drakbackup knows what, where and when to perform the backup. We will guide you step-by-step with a back up-and-restore example using the wizard. Then we will introduce you to automation of periodic backups.

8.1. A Practical Example Using the Wizard

Figure 5.16. Main Drakbackup Window

Main Drakbackup Window

Start Drakbackup by clicking on the Backups icon in Mandrakelinux Control Center's System section. Click on the Wizard Configuration button to start the wizard. After making your choices in each step click on Next.

8.1.1. First Step: What to Backup

Figure 5.17. Selecting What to Backup

Selecting What to Backup

Select Backup System to include the /etc directory where all your current system configuration files lie. This allows you to “transport” your system to a different computer with little effort: only hardware-dependent configuration will have to be revised.

[Note]Note

The “system” backup does not include applications themselves (i.e. executable files, libraries). A priori this makes sense because it is likely that you will have access to the system's installation media from which applications can be easily installed again on the target computer.

Select Backup Users to include all the files included in all of your users' /home directories. Clicking on the Select user manually button will let you select individual users and give you the following options:

  • Do not include the browser cache. Select this to exclude the web browser's cache from the backup file set. Recommended due to the very nature of the browser's cache.

  • Use Incremental/Differential Backups. Selecting this will preserve old backups. Choosing Use Incremental Backups will only save files which have been changed or added since the last backup operation. Choosing Use Differential Backups will only save files which have been changed or added since the first backup operation (also known as the “base” backup). This last option takes more space than the first one, but allows you to restore the system “as it was” at any given point in time for which a differential backup was made.

8.1.2. Second Step: Where to Store the Backup

Figure 5.18. Selecting Where to Store the Backup

Selecting Where to Store the Backup

Select Across Network to store the backup on a remote computer accessible using either ssh, FTP, rsync or WebDAV. A machine name or IP address, a user name and password on that machine, a directory on that machine, and the access method and its options (if applicable) must be specified by clicking on the corresponding Configure button.

Select On Tape Device to store the backup on a tape drive. Click on the corresponding Configure button to set the tape device and tape parameters such as whether or not to rewind, erase and eject the tape.

Select On CD-R to store the backup on optical media: (re)writable CD or DVD. This is our preferred media for the example, so click on its Configure button to set the required parameters (see Figure 5.19, “Setting Optical Media Parameters”).

Figure 5.19. Setting Optical Media Parameters

Setting Optical Media Parameters

If it isn't done automatically, use the Choose your CD/DVD device combo box to set the CD/DVD device. In our example, we chose ATAPI:/dev/hdd, which is an IDE recorder. We chose a 700 MB medium size and a re-writable medium (the CDRW media option is selected).

Select the Erase your RW media option to erase the data on your re-writable media before each backup is performed. If you select the Multisession CD option, only the 1st session will erase the media. Session-related information recording takes some space out (20 to 30 MB) for each session, so the “real data” storage space will actually be less than the medium's size.

8.1.3. Third Step: Review and Store the Configuration

Figure 5.20. Review Configuration Parameters

Review Configuration Parameters

The last wizard step shows a summary of the configuration parameters. Use the Previous button to change any parameter you are not satisfied with. Click on Save to store them. Drakbackup is now ready to perform backups.

8.1.4. Performing the Backup

Figure 5.21. Backup Progress Dialog

Backup Progress Dialog

Click on Backup Now and then on Backup Now from configuration file to display a confirmation dialog with Drakbackup's parameters: make sure the corresponding media (the CD-RW disk in our example) is ready and click on Build Backup to start the backup operation.

[Warning]Warning

If the backup set size exceeds the medium's available capacity, Drakbackup might just fail. This is a known issue and it's being worked on. As a work-around, please try to remove files from the backup set so its size never exceeds the medium's available capacity.

A dialog (see Figure 5.21, “Backup Progress Dialog”) will display the current progress of the operation. Please be patient: the time it takes to back up depends on many factors such as the size of the backup file set, the speed of the storage option selected, and so on. Once the operation is finished a report will be shown: look for possible errors on it and take corrective measures if needed.

8.2. Restoring Backups

Figure 5.22. Choosing the Restore Type to Perform

Choosing the Restore Type to Perform

Make sure the media you want to restore the backup from is accessible and ready. Then click on Drakbackup's Restore button. In our example we will restore the whole backup so on the restore dialog (Figure 5.22, “Choosing the Restore Type to Perform”) click on Restore all backups. A dialog will show you the current restore settings. Click on the Restore button to start the restoration process.

[Warning]Warning

Existing files in the target restoration directory (same location where the backup was made from, by default) will be overwritten.

Feel free to investigate the other restore options if you want to restore part of a backup instead of the full file set.

8.3. Automating Periodic Backups

Figure 5.23. Daemon Options Window

Daemon Options Window

In Drakbackup's main window, click on Advanced Configuration and then on the When button. The backup scheduling window will appear (see Figure 5.23, “Daemon Options Window”). Select Use daemon to define the schedule. You will then be asked to specify the interval (or period) between each backup operation and the storage media. In our example we set up a customized calendar (custom period selected) to perform a backup every Friday at a quarter to midnight and store it on CD. You can also specify hourly (i.e.: performed 1 minute after the hour), daily (i.e.: performed at 4:02AM), weekly (performed at 4:22AM) and monthly (performed at 4:42AM) periods instead of custom.

8.4. Other Drakbackup Options

Figure 5.24. Miscellaneous Options Window

Miscellaneous Options Window

Click on Advanced Configuration and then on the More Options button. The miscellaneous options window will appear (see Figure 5.24, “Miscellaneous Options Window”).

Use the Please choose the compression type pull down list to select the compression used for your backups among tar (no compression), tar.gz (gzip compression) and tar.bz2 (bzip2 compression: better but slower).

Select the Use .backupignore files option to have Drakbackup exclude certain files from the backup. The .backupignore file should be present in every directory of the backup file set where files are to be excluded. Its syntax is very easy: a one-file-per-line list of the names of the files to exclude.

[Tip]Tip

You can use the star (* = “matches any string”) and the question mark (? = “matches one and only one character, regardless of what that character is”) in the .backupignore file to exclude sets of files. For example, somename* will match all files whose names start with somename, and image00?.jpg will match files named image001.jpg, image009.jpg, image00a.jpg, image00h.jpg, etc.

Select the Send mail report after each backup to option and fill the e-mail address so Drakbackup knows to whom to mail the backup operation report. Please bear in mind that the system needs to have a working MTA (Mail Transport Agent) for this option to be effective.

[Tip]Tip

If you want to send the report to more than one recipient, you will have to set up a mailing list, containing all those addresses, and fill the field with the mailing list's post address.

All methods other than NFS use the hard disk drive to store temporary files. Select the Delete Hard Drive tar files after backup to other media option to have Drakbackup free that space after performing the backup.