Chg-multiplex
chg-multiplex
chg-multiplex is a wrapper, that uses multiple backup configs. It is mainly intended for use as a restore script. I use it with this config:
- Weekly level-0 goes to tape
- Daily level-n goes to disk
The backup is easy, but automated restore is not possible. In this case chg-multiplex can help you to restore your data
download
chg-multiplex put into your libexec directory and rename to chg-multiplex. needs executable bit set.
configuration
For above example, you'll make 3 configs: Daily, Weekly and Restore. Make sure, that the infofile, logdir, indexdir, tapelist variables all point to the same location, so that all configs operate on the same database.
each configuration should have a fully functional changer and tape config. each configuration must have a different labelstr variable, and the tapes must have labels, that match only one labelstr. the restore config uses a labelstr, that matches all tapes.
restore uses the chg-multiplex. the changerfile of chg-multiplex is of the form
CONFIGS='Daily Weekly' CONFSTAT='/opt/amanda/var/amanda/changer-multiplex-lastconf'
CONFIGS lists all configs to use as a space-seperated list. CONFSTAT is a file, where the last used config is stored. it must be writable to your backup user.
how it works
chg-multiplex does nothing on its own, it just passes all commands to the underlying configs. chg-multiplex behaves like a single changer, that has a number of slots equal to the sum of all slots from the underlying configurations. If a specific tape is requested from amanda, it uses the labelstr variables of the underlying configs to determine which config to use. If only the next tape is requested, it will always rotate within one config.