As described in the backup script (/root/backup-fs), the backup scheme is composed of ten steps:
Read and parse configuration file
Loop through each backup
Create a FS snapshot using LVM
Mount the snapshot FS
Mount our backup file in a loop filesystem (we can guarantee the space will be present this way, and it allows selective recovery of files if need be)
rsync the differences between the snapshot FS and the backup FS
Unmount the backup FS
Unmount the snapshot FS
Delete the snapshot LVM (leaving it will degrade performance)
Repeat steps 3-9 if necessary
For this script to function, though, the initial backup structure must be made. The large portion that needs to be done manually is creating the backup file, but in order to do so, most of the steps outlined above will be performed.
First, create our backup file by touching /mnt/smb/userdata/root/FC6-Backup-File, and also create a the backup mount points at /mnt/FC6-Snapshot and /mnt/FC6-Backup. Next, start the backup process, replacing the -L option's arguments to be whatever size of volume you are backing up and the path with the path to your volume:
This is where the manual steps come in. Instead of mounting the file systems and using rsync between them, we want to copy the initial system, and conveniently we'll develop a file system large enough within the backup file simultaneously using dd.
Wait for the copy to complete (it'll be a while). When that is done, confirm the file backed up the root file system, and then delete the snapshot file system.
Now we can configure the backup script. Edit backup.conf, following the comments already present in the file. Output filters are supported with the LOG_EXCLUDE “variable”, and each backup pair is created by separating the volume's mount point and the backup image file with a colon on separate lines.
Enabling automatic backups is as easy as adding an entry in a cron tab or placing a link in one of the special cron directories. We want to backup nightly, so we'll add a link to /root/backup-fs: