[ADD] Add backup rotation from Gunnar with some minor changes.
[FIX] Rename db_name parameter.