Move required parameters check in lib/backup to private method

Refactors logic to its own method, no behavior change with this
commit.