How to backup to disk using flexbackup on e-smith By: Des Dougan (ddougan@telus.net) Release: 0.1, 13 September 2001 Acknowledgements _______________________________________________________________________ Customizing flexbackup within the e-smith template system was suggested to me by Darrell May, after I'd gone down a separate route. Darrell's solution, contained herein, is more elegant and e-smith-compliant. Summary _______________________________________________________________________ This document explains how to use flexbackup and the e-smith manager to run a scheduled backup to a disk drive on a client workstation. It has been tested with version 4.1.2 and should work with versions 4.1.1 and 4.1. Introduction _______________________________________________________________________ I run e-smith on my small home LAN. Currently, I'm without a tape drive but wanted to backup my server to a spare disk on my desktop PC. This How-To does this using existing e-smith features, in part customized via the template system. Creating a filesystem share on the desktop (Windows) PC _______________________________________________________________________ In Explorer, create the directory you want to backup to. Select it, right click and select the "Sharing" option. Create a share name of "Backup". Make sure it is writable by all (this is dependent on your Windows OS. In Win2K, this is done from the "Permissions" dialog on the "Sharing" tab). The default settings should be OK here. Setting up the mount and fstab _______________________________________________________________________ The Linux convention is to mount removable media from /mnt. Create a directory called /mnt/backup to act as mount point for the share created previously. Using your favourite editor, add an entry to /etc/fstab for the share: //servername/sharename /mnt/backup smbfs username=name,password=pword where "servername" and "sharename" are the name of the PC and the share you created previously. /mnt/backup identifies the mount point, while the username and password pair are the userid and password used to logon to the PC (required for NT and Win2K systems). smbfs denotes the mount as using the smb file system. Configuring the flexbackup templates _______________________________________________________________________ The standard e-smith backup routines, configured via the manager, are run from /sbin/e-smith/backup. As is the e-smith way, this script is built from template fragments held in the directory /etc/e-smith/templates/sbin/e-smith/backup. The following steps must be followed to customize it for our purposes: 1. Having logged into the server as root, type the following commands. mkdir -p /etc/e-smith/templates-custom/sbin/e-smith/backup cd /etc/e-smith/templates-custom/sbin/e-smith/backup cp /etc/e-smith/templates/sbin/e-smith/backup/* . 2. These steps will have left you with 9 template fragment files in the directory you've just created. 3. Using your favourite editor, delete the contents (not the files themselves!) of fragments "20probe-tape" and "90rewind-tape". 4. Optionally, edit the fragment "00check-enabled" and change the two instances of "Tape" to "Network". 5. Create a new fragment "25mount-share". This should contain: mount /mnt/backup which mounts the filesystem share created earlier. 6. Create a second fragment called "95umount-share", containing: umount /mnt/backup this unmounts the share after the backup has completed. The template then needs to be expanded to create the new version of the backup script: /sbin/e-smith/expand-template /sbin/e-smith/backup Configuring flexbackup to write to disk _______________________________________________________________________ Flexbackup can be configured to backup to a disk by simply changing the "$device" variable in /etc/flexbackup.conf via the e-smith way by entering: /sbin/e-smith/db configuration setprop backup Device /mnt/backup /sbin/e-smith/signal-event conf-backup Configuring the e-smith manager and (optionally) cron _______________________________________________________________________ In the Administration section of the manager, select "Backup or restore", then select the "Configure tape backup" action. Check the "Enable tape backup" box and the time for both the backup and reminder selections. Hit the "Update Configuration" button. That's it! Done, finished, complete; unless, of course, you don't want to backup on a daily basis (I run mine weekly). The cron entry for the backup is located in /etc/cron.d/backup. It has two entries, one for the reminder and the second for the backup. These can be edited to meet your scheduling needs (use "man cron" if you need help here). Summary _______________________________________________________________________ This procedure provides an e-smith standard way of backing up to disk. However, as Darrell May has pointed out, its strength lies in its flexibility when restoring, as the power of flexbackup is available to you. Good luck!