How To:Delay writing to tape for better tape utilization

From The Open Source Backup Wiki (Amanda, MySQL Backup, BackupPC)

Jump to: navigation, search

This article is a part of the How Tos collection.

"Old School" (pre-2.6)

Before Amanda 2.6, there was no way to tell Amanda not to use a tape if a perfectly usable tape is sitting in your tape drive or tape library. This is more commonly a problem for people with tape libraries where the changer will happily load the next tape Amanda wants to use supposing it is available . . . which it commonly is. If, for better tape utilization, you want to delay the writing of tapes, there is a way you can prevent Amanda from using the next tape with amdump's -o flag ("o" for options). Should you rather spool backups to holding disk than use the next available tape, you can use an alternate amdump command such as:

amdump daily -o reserve=100 -o tapedev=""

or if you have a tape changer

amdump daily -o reserve=100 -o tapedev="" -o tpchanger=""

The -o reserve=100 causes all backups to drop back to incremental-only should you regularly specify a reserve less than 100% in your amanda.conf. The -o tapedev="" and -o tpchanger="" overrides your usual tape and changer device names with an emptry string ("") preventing Amanda from finding a usable tape. This forces writing to holding disk even if a usable Amanda-labeled tape is currently sitting in your tape drive. If you have a tape changer, the override of tpchanger="" is necessary. Without this, Amanda will talk to your tape changer to find the actual tape device name.

Of course, backups spooled to the holding disk will only sit there unless you periodically run amflush(8) or set the autoflush parameter to "yes" in your amanda.conf(5).

Here is a crontab example which uses a tape each weekday while still performing backups over the weekend (yet without tapes)

45 0 * * 1-5 /usr/local/sbin/amdump daily
45 0 * * 0,6 /usr/local/sbin/amdump daily -o reserve=100 -o tapedev="" -o tpchanger=""

The weekend dumps to holding disk are automatically flushed to tape with the Monday night backups due to the amanda.conf(5) parameter autoflush. (Thanks to User:Choogendyk)

"New School" (2.6 and later)

Amanda version 2.6.0 and later has a parameter, where you can delay the tape writing until enough data has collected on the holdingdisk. See the parameters flush-threshold-dumped and flush-threshold-scheduled in amanda.conf(5).

Assuming the holdingdisk is large enough, you can add the parameter:

 flush-threshold-dumped 100

This will delay the writing to tape until the amount to fill one whole tape has been collected on the holdingdisk.


Other languages: English  • Fran├žais


Personal tools