Updated so that all necesary parent directories are created when creating the archive directory.