Wednesday, March 5, 2008

Restoring ViaRemote Backups in Linux

From the client program you are able to view your backup history and restore files. The client program must be run from a remote shell session. The client program for Linux is called "avtar" and resides in /usr/local/avamar/bin. A symlink is also created at install time and is located at /usr/bin/avatar.

Snapups are the name for the backup set/backup package being taken. Each snapup takes backups of the directories/files that were setup when we started your backup service.

The basic syntax of avtar is:

avtar --command --id=[clientid]@/[clientid] --account=servers/[hostname] (additional options)

A password will also be necessary in order to access the backups. This will be included in the setup email. You will be prompted for this password for every backup operation.

Please note that Client ID will always be the same as your Ubersmith Customer ID. This may also be referred to as your Restore Account User name. For the examples used in this guide, we'll be using a client id of "98765" and a host name of "cftest.fastservers.net" with a password of "changeme".

Restoring Files

Restoring files are handled with the --extract command.

The base syntax for the extract command is:

avtar --extract --id=[clientid]@/[clientid] --account=servers/[hostname] --seq=N

What is a sequence number? :: Sequence numbers refer to the iteration of the backup. VerifyLinuxBackups to retrieve the sequence number you want to restore.

In this section, we’ll discuss the three most common types of manual restore operations:

* Type #1 - Restoring all files and directories to their original locations.
* Type #2 - Restoring all files and directories to an alternate directory.
* Type #3 - Restoring individual files and directories to an alternate directory.

Restoring all files and directories to their original locations

In this type of restore, we’ll be restoring all files contained in the backup set dated 5/23 for our test machine, cftest.fastservers.net, to their original locations. Remember from our previous examples that the backup set from 5/23rd has a Seq number of 1. You can always obtain the Sequence number by pulling up a backup history for the server.

The command line string would be:

avtar --extract --id=98765@/98765 --account=servers/cftest.fastservers.net --seq=1

Restoring all files and directories to an alternate directory

In this type of restore, we’ll be restoring all files contained in the backup set dated 5/23 to our test machine, cftest.fastservers.net, to an alternate directory called /restore. Remember from our previous examples that the backup set from 05/23 has a Seq number of 1. You can always obtain the Sequence number by pulling up a backup history for the server.

The command line string would be:

avtar --extract --id=98765@/98765 --account=servers/cftest.fastservers.net --seq=1 --target=/restore

Restoring individual files and directories to an alternate directory

In this type of restore, we’ll be restoring a specific file contained in the backup set dated 5/23 to an alternate directory called /restore. Remember from our previous examples that the backup set from 5/23 has a Sequence number of 1. You can always obtain the Sequence number by pulling up a backup history for the server.

We’ll be restoring the file “/root/init.txt” from the 05/23 backup set to a directory called /restore. You must specify the full path of the file contained in the backup set. The operation would fail if we passed only “init.txt” to the backup client. You can always obtain the full path of the file within the backup set by listing the contents of the backup set.

The command line string would be:

avtar --extract --id=98765@/98765 --account=servers/cftest.fastservers.net --seq=1 --target=/restore /root/init.txt

The backup client will then begin restoring the file or directory from the backup server. Once this process has been completed, the command will exit.

Please note that if files of the same name already exist in target directory, the client will not restore those files and will skip them instead. This is to prevent accidental file overwrites.

If the requested target directory does not exist, the backup client will create it for you.

No comments: