Bytemark VHost : Automated Backups

Our automated backup system should prevent you from losing files due to accidental deletion. However because the backups are stored locally upon your own machine they will not protect you against complete system failure.

To give you true redundancy the local backups will need to be synced to our remote NFS server.

Things that are backed up

Your system will maintain full backups, running once a day, of the following locations:

  • /root
  • /home
  • /etc
  • /usr/local
  • /srv

Additionally every MySQL database you have upon your system will also be exported and backed up.

Backup Recovery

The backup system we're using is backup2l, and it is configured to backup your precious files beneath the directory /var/backups/localhost`.

To find the latest version of the file /etc/passwd in the backups you must run:

root@example:~# backup2l -l '/etc/passwd$'
backup2l v1.4 by Gundolf Kiefer

Active files in <all.1101>: 1
  found in all.1101:       0   (    1 left)
  found in all.11:         1   (    0 left)

Listing locations...
all.11: /etc/passwd

All required archive files are present in /var/backups/localhost.

The dollar sign is there to show that you want an exact match of /etc/passwd. This shows the latest available version of the file, and to recover it you should run:

root@example:~# backup2l -r '/etc/passwd$'
backup2l v1.4 by Gundolf Kiefer

Active files in <all.1101>: 1
  found in all.1101:       0   (    1 left)
  found in all.11:         1   (    0 left)

Restoring files...
  all.11.tar.gz: 1 file(s) using 'DRIVER_TAR_GZ'

That has restored the file to etc/passwd in the current directory. It is not recommended to run this program in the / directory, as any existing files will get overwritten.

Recovery from earlier backups

To show all available versions of a file, run:

root@example:~# backup2l -a '/etc/passwd$'
backup2l v1.4 by Gundolf Kiefer

Listing available files...
all.101   -     1067 06/18/08 13:59:47 0000.0000 0644 /etc/passwd
all.101   +     1118 06/19/08 11:29:10 0000.0000 0644 /etc/passwd
all.108   -     1118 06/19/08 11:29:10 0000.0000 0644 /etc/passwd
all.108   +     1153 08/27/08 10:25:45 0000.0000 0644 /etc/passwd
all.11    -     1067 06/18/08 13:59:47 0000.0000 0644 /etc/passwd
all.11    +     1153 08/27/08 10:25:45 0000.0000 0644 /etc/passwd
all.1     +     1067 06/18/08 13:59:47 0000.0000 0644 /etc/passwd

Note that the versions are not shown in date order, and that the dates are in the US mm/dd/yy format. In that list the ’+’ indicates that the file is new and thus contained in the archive file. A ’-’ indicates that the file has been removed (or replaced). Choose which backup you wish to recover from. For example, we require the file dated 19th June 2008, so we need backup number 101 -- remember the '+' indicates that it is present in that archive. Now we run:

root@example:~# backup2l -t 101 -r '/etc/passwd$'
backup2l v1.4 by Gundolf Kiefer

Active files in <all.101>: 1
  found in all.101:        1   (    0 left)

Restoring files...
  all.101.tar.gz: 1 file(s) using 'DRIVER_TAR_GZ'

Notice the -t 101 argument which specifies which backup we want to restore from. Now that has restored the file to etc/passwd in the current directory.

root@example:~# ls -la etc/
total 16
drwxr-xr-x  2 root  root  4096 2008-09-09 09:56 .
drwxr-xr-x 14 root  root  4096 2008-09-09 09:51 ..
-rw-r--r--  1 root  root  1118 2008-06-19 11:29 passwd

Bingo! We've got the version of the file we wanted to restore.