FAQ:How do I make Amanda do full backups on weekends and incrementals during the week?
From The Open Source Backup Wiki (Amanda, MySQL Backup, BackupPC)
This question usually takes the forms:
- "How do I make Amanda do full backups on Saturday and incrementals ... ?"
- "My backup screwed up on tuesday and now it keeps asking for the tuesday tape even though it is wednesday!"
The short answer is: You can't.
The longer answer is: You can. But you should not.
The reason: Amanda is designed to schedule your backups. Let "her" do it.
When you want to make the best use of Amanda, you have to let go the classic schedule where one used to have one tape dedicated to each day of the week, and one for the friday.
The main difference in concept is this:
In the classic backup scheme you said:
- "I want to have incremental backups from Mo-Th and a full backup on Fr."
Using Amanda you say:
- "I want to have at least one full backup in 5 days."
So you don't have to specify exactly WHEN the full backup should happen. You just tell Amanda some goals it should reach and let it work out the details.
There are several advantages in this:
Imagine that you have your classic backup-schedule running fine. Everything is calculated and designed well, so your tape gets filled well each night. Now one user generates an unforeseen huge amount of data. For example, he duplicates one big data-directory by mistake. So the size of the directory raises within one day, maybe for multiple GBs.
Would your classic backup-scheme catch that? Or would it run out of tape, simply because it was not calculated to have that filesystem with that size?
Amanda would try to catch it (and most of the time succeed ...).
As there is the estimate-phase before actually dumping something, Amanda can look at the DLEs and determine the actual size at the time. It also determines the size of an incremental backup so it can test for the Plan B to just run a level-1 if it does not work out to do a level-0 for that DLE.
If the size of the DLE is much bigger than it has been the run before, Amanda still tries to meet your goals. It just reschedules stuff, combining full and incremental backups to meet the goals as good as possible.
So you can think of it as some algorithm which lets Amanda adapt to your data. If you set the goals in a reasonable way, Amanda will just do the rest.
IF YOU INSIST ON DOING WEEKLY FULL BACKUPS DESPITE ALL THIS ADVICE
This is not recommended procedure, but for environments that insist on weekly or monthly full backups.
- Edit amanda.conf to insure that incremental dump settings take more than a week to force the next full dump.
- Edit amanda.conf to make sure that it includes a separate disklist.
- Create a disklist.daily file. This is your reference disklist, and uses normal incremental dumps.
- Create a script to edit disklist.daily into a disklist.full file, by replacing the dump options with "always-full" or a similar option.
- Set your daily cron job for every day but Friday, to duplicate disklist.daily to disklist.
- Set your Friday cron job to create disklist.full from disklist.daily, then duplicate disklist.full to disklist. Disklist.full is simply for reference for the next week, in case it's needed.
Another way using Configuration Override would be (no need to modify the disklist file)
- Run amdump with parameter "-o DUMPTYPE:default:strategy=nofull" for every day except Friday (suppose you want to have full backup on Friday, and the dumptype is named 'default' in disklist).
- Run amdump with parameter "-o DUMPTYPE:default:strategy=noinc" on Friday.
Both works well as long as Friday's dumps are successful, and are completed before the next day's dumps begin. It's also extremely useful for scheduling full backups before major operating system upgrades or facility transfers, without interfering with your default system behavior.