rmg_backup: reordered directory creation so failure of database directory happens later