14.3. Adding a New Backup

If you want to backup a directory, either just occasionally or on a regular schedule, you first need to add a new backup configuration. This specifies a directory to backup, a set of options to use, and the times at which it should be scheduled to run. The steps to follow to create a new configuration are:

1.
On the main page of the module, enter the path to the directory that you want to backup into the field next to the Add a new backup of directory button. When you click the button, Webmin will determine what type of filesystem the directory is in (ext2, ext3, or xfs) and display a backup creation form with options for that filesystem type. Figure 14.2 shows the form for an ext2 or ext3 backup.

Figure 14.2. The new backup configuration form.


2.
The path you entered will appear in the Directory to backup field. You can still change it if you wish, as long as the new directory that you enter is still on the same filesystem.

3.
If backing up to a local file, set the Backup to field to the File or tape device option and enter the file that you want the backup written to into the text field next to it.

Backing up to a tape drive is similar to writing to a file, but instead of entering a filename into the File or tape device field you must enter the device file for the tape drive. For example, /dev/st0 would be the device file for the first SCSI tape drive on your system.

If backing up to another server, you must select the Host option for the Backup to field and enter a hostname, remote username, and file or device name on the remote server. The server must have the shell service enabled in its Internet Services module, as explained in Chapter 15. An appropriate .rhosts file must also be set up for the target user, to allow the dump command to connect without needing to supply a password.

4.
If your backup is being written to a local file that you do not want to be larger than a certain size, set the Split across multiple files? option to Yes and enter the maximum size in kilobytes into the Tape size field. This can be useful if the backup is going to be later saved to multiple CDs or Zip disks.

5.
If you are doing multiple backups at different levels as explained in the introduction, change the Dump level field to something other than Full backup. However, if you want each backup to contain all files in the source directory, leave it unchanged at level 0.

6.
If you are backing up to a tape, it is a good idea to set the Tape size field to the number of kilobytes that can fit on your tape. Otherwise, the dump command may underestimate the amount of data that can be written and fail to complete the backup.

7.
The chattr command can be used to mark a file to be skipped when making backups, which can be useful if the directory contains huge and useless files that you would rather not save. However, when doing a level 0 backup such files will be included, unless the Always exclude marked files? field is set to Yes.

8.
If you are familiar with the dump command used on your operating system, the Extra command-line parameters field can be used to enter extra options to be passed to the program, such as – A /tmp/archive. Otherwise, leave it blank.

9.
To have commands run before and after the dump command is executed, fill in the Command to run before backup and Command to run after backup fields. These commands will be run as root when the backup is made, either as scheduled or manually through Webmin. They can be useful for loading and unloading tapes, or copying files into the backup directory before it is saved.

10.
If you want the backup to be run on a regular schedule, set the Scheduled backup enabled? option to Enabled and select the times and days for it to run from the lists at the bottom of the page. The user interface for date and time selection is exactly the same as the one used by the Scheduled Cron Jobs module, explained in Chapter 10.

11.
To have a status report of the scheduled backup emailed to you, enter your email address into the Email scheduled output to field.

12.
By default, the subject of the backup email will be something like Dump of /etc. If you are using this module on multiple systems, you may want to customize the subject line so that the host the email is coming from and the data that has been backed up is more obvious. To do this, de-select the Default option for the Email message subject field, and enter a new subject line into the text field next to it.

13.
Finally, click the Create button to save the details of the new backup configuration. If there are no errors in the form, you will be returned to the modules main page.

Alternatively, you can begin a backup immediately by clicking Create and Backup Now. This will take you to the page showing its progress, as explained in Section 14.4 “Making a Backup”.

Apart from ext2 and ext3, the only other filesystem type that has a similar backup command is xfs. Because its xfsdump command has slightly different options, the fields on the new backup form are not quite the same as described above. One important difference is that the Directory to backup must be the mount point of a filesystem, not just any directory within it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.105.72