Difference between revisions of "How To:Copy Data from Volume to Volume"

From The Open Source Backup Wiki (Amanda, MySQL Backup, BackupPC)
Jump to navigationJump to search
m
m (Change --autolabel all to --autolable any)
Line 10: Line 10:
 
Assuming that you have a full vtape configuration set up, and wish to duplicate vtapes onto physical tapes in <tt>/dev/nst0</tt> for off-site storage.
 
Assuming that you have a full vtape configuration set up, and wish to duplicate vtapes onto physical tapes in <tt>/dev/nst0</tt> 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 <tt>chg-robot</tt> to allow spanning over multiple destination tapes.  Next, pick a label template that matches your <tt>labelstr</tt>, but has some characteristic that can help you distinguish it as tertiary media, e.g., <tt>DailySet1-9%%</tt>.  Finally, pick the autolabel technique you'd like to use for the tertiary media.  If you are not worried about accidentally overwriting tapes, use <tt>--autolabel all</tt>.
+
First, ensure that your nightly runs are not too large to fit on tape.  If they are, you may need to set up <tt>chg-robot</tt> to allow spanning over multiple destination tapes.  Next, pick a label template that matches your <tt>labelstr</tt>, but has some characteristic that can help you distinguish it as tertiary media, e.g., <tt>DailySet1-9%%</tt>.  Finally, pick the autolabel technique you'd like to use for the tertiary media.  If you are not worried about accidentally overwriting tapes, use <tt>--autolabel any</tt>.
  
 
Finally, set up something like the following to run from cron after the amdump run is complete:
 
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 \
 
  amvault -q --src-timestamp latest --dst-changer tape:/dev/nst0 \
     --autolabel all --label-template DailySet1-9%% DailySet1
+
     --autolabel any --label-template DailySet1-9%% DailySet1
  
 
The <tt>latest</tt> key will select the most recent amdump run, and vault that onto <tt>/dev/nst0</tt>.
 
The <tt>latest</tt> key will select the most recent amdump run, and vault that onto <tt>/dev/nst0</tt>.

Revision as of 16:02, 29 September 2015

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 matches your labelstr, but has some characteristic that can help you distinguish it as tertiary media, e.g., DailySet1-9%%. 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 DailySet1-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 DailySet1-9%% 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|中文(中国大陆)‎]]}}|}}