How To:Copy Data from Volume to Volume

From The Open Source Backup Wiki (Amanda, MySQL Backup, BackupPC)
Revision as of 16:21, 13 September 2017 by Nathanst (talk | contribs) (add a section discussing Amanda 3.4 syntax)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This article is a part of the How Tos collection.

Amanda uses the term "vaulting" to describe copying data from one volume to another. This is most often used to extract dumps for archiving, so the source volumes are generally referred to as "secondary media" and the destination volumes as "tertiary media".

The tool to use for vaulting is, appropriately enough, amvault(8).

There are a few scenarios where you might want to apply this tool.

Duplicating Vtapes to Real Tapes

Assuming that you have a full vtape configuration set up, and wish to duplicate vtapes onto physical tapes in /dev/nst0 for off-site storage.

First, ensure that your nightly runs are not too large to fit on tape. If they are, you may need to set up chg-robot to allow spanning over multiple destination tapes. Next, pick a label template that allows you distinguish it as tertiary media, e.g., Vault-%%%. You will also need to pass in a labelstr format that matches that. Finally, pick the autolabel technique you'd like to use for the tertiary media. If you are not worried about accidentally overwriting tapes, use --autolabel any.

Finally, set up something like the following to run from cron after the amdump run is complete:

amvault -q --src-timestamp latest --dst-changer tape:/dev/nst0 \
   --autolabel any --label-template Vault-%%% -olabelstr='^Vault-[0-9][0-9][0-9]$' DailySet1

The latest key will select the most recent amdump run, and vault that onto /dev/nst0.

Extracting Fulls to Cloud Storage

In this case, you want to take full dumps only and extract them to offsite cloud storage.

First, set up a defined changer to represent your cloud storage; see How To:Backup to Amazon S3 for details. For example:

define changer "cloud" {
  device_property "S3_ACCESS_KEY" "1ATXQ3HHA59CYF1CVS02"
  device_property "S3_SECRET_KEY" "09dfma0928m0sd9f8m-adf/asdf098asdf"
  tpchanger "chg-multi:s3:1ATXQ3HHA59CYF1CVS02-backups/DailySet1/slot-{01,02,03,04,05,06,07,08,09,10}"
  changerfile  "s3-statefile"                                           # Amanda will create this file
}

You'll then specify this changer as --dst-changer. The rest is similar to above: invent a label template, and set up --autolabel properly. This time, though, the --fulls-only flag will extract only full dumps.

amvault -q --src-timestamp latest --fulls-only --dst-changer cloud \
   --autolabel any --label-template Vault-%% -olabelstr='^Vault-[0-9][0-9]$' DailySet1

Amanda 3.4

Starting in Amanda 3.4, amvault can make use of storage definitions so that command line options aren't needed to specify all the various options. For example, after adding the following to amanda.conf (below the definition for the cloud changer):

define storage cloud_storage {
   tpchanger "cloud"
   tapepool "$r"                          # pool name set to storage name
   labelstr "^Vault-[0-9][0-9]*$"
   autolabel "Vault-%%" any
}

, the equivalent amvault command would be simply:

amvault -q --src-timestamp latest --fulls-only --dst-storage cloud_storage DailySet1



Other languages: [[::How To:Copy Data from Volume to Volume|English]] {{#ifexist: {{#if: | | {{#if: | :}}How To:Copy Data from Volume to Volume}}/Fr |  • {{#if: |français| [[::How To:Copy Data from Volume to Volume/Fr|français]]}}|}}

{{#ifexist: {{#if: | | {{#if: | :}}How To:Copy Data from Volume to Volume}}/Zh-cn |  • {{#if: |中文(中国大陆)‎| [[::How To:Copy Data from Volume to Volume/Zh-cn|中文(中国大陆)‎]]}}|}}