I want to mirror the Raspbian Repository from home. The example at http://raspbian.org/RaspbianMirrors says that this can be done in the following way:

rsync --archive --verbose --delete --delete-delay --delay-updates \
archive.raspbian.org::archive /path/to/local/mirror

However, if rsync stops for whatever reason then the whole process needs to be started again. My question now is how this can be prevented and instead be resumed.

What I tried so far:

I had a look into rsync's manual and there I found the --append-verify flag which exactly seems to do what I want. Unfortunately: when I add that flag to the command above then I receive the following error message:

rsync: --append cannot be used with --delay-updates rsync error: syntax or usage error (code 1) at main.c(1572) [client=3.1.1]

Accordingly to rsync's manual it looks like that I need --delay-updates too.

--delay-updates: put all updated files into place at end

If files are updated during the sync process I for sure also want to sync them.

So: how can I rsync the Raspbian Repository while being able to resume the rsync process in case that it stopped? What I need is one complete and integer mirror of the whole Raspian Repository.


There are a few options. 1.) Probably the "best" is ftpsync, which despite the name actually uses rsync. It is the only approved way of mirroring official Debian repositories, and by extension Raspbian repos. ftpsync uses a 2 step approach to ensure consistency of your local mirror at (nearly!) all points in the sync process. Rsync still does a full traversal of the repository to look for changes on each run, twice, but bandwidth use during that process is negligible, and it's pretty quick. Tarball link is here: https://www.debian.org/mirror/ftpmirror

2.) For a "simpler" method, apt-mirror uses a config in /etc/apt/mirror.list to pull debs and make a local mirror as well. Since it uses wget, which has a less rigorous transfer regime than rsync, I've found that it sometimes corrupts a few files here and there, seemingly from partial download errors. It skips over these on subsequent downloads, meaning manual fix is necessary. I've used "rsync -rtP --existing" to clean up the pool directories successfully, but it would be nicer if it wasn't necessary. apt-mirror should be available in the normal repositories.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.