We have a RPM repository (on a Centos 6 machine) that we need to push to another machine. So far we've been using rsync -av --delete
to simply push the repo directory over the network. This makes the remote repository unusable during the sync – before rsync
finishes, repodata
don't match the present rpm packages and the synchronization of repodata
is also not atomic.
How can I synchronize two repositories atomically over ssh?
I would like the remote repository to be usable at any time, even during the transfer of data. I know I could achieve this copying the repo to a temporary directory, and then moving/symlinking it, but it feels like there should be a better solution.
Best Answer
Use reposync from the yum-utils package. man page. I think it still works with
dnf
if your yum got replaced by that.reposync
is a python script. We can see it doesand if we look at
pydoc yum.YumBase
there isso it seems to lock against other yum accesses, which may not be what you want.