Question: I got a local repository in `/var/www/html/centos/7` directory. In here, all rpm packages from centos are downloaded.
I will create a crontab for updating my local repository every 1 week or sth.

I want to learn that does `repocreate --update` do this? Or should I download all the packages from centos repo again?

If I should download the packages from centos repo, is there a way to skip the downloaded packages (they're in `/centos/7` directory as I mentioned) and download just the new (updated) packages from centos?

UPDATE

I have found the solution but it's not working for me. I created a new directory centos7/repo and download some files to check if the rsync --ignore-existing will work. But whenever I run the below command, I got an error

```
failed to connect to ftp.linux.org.tr (193.140.100.100): Connection timed out (110)

rsync: failed to connect to ftp.linux.org.tr (2001:a98:11::100): Network is unreachable (101)

rsync error: error in socket IO (code 10) at clientserver.c(125) [Receiver=3.1.2]

```

The command is:

```
rsync -avz --ignore-existing rsync://ftp.linux.org.tr/centos/7/os/x86_64/ /var/www/html/centos7/repo/

```

I tried other mirrors as well from <https://centos.org/download/mirrors/> (there are rsync location in this site as well). But none of them worked. Can anybody validate that rsync mirrors does work? Probably I can't go through firewall with port 873.

Is there anyway that I can use this rsync through port 80 or is there another way to accomplish this task? (I tried zsync but it needs a zsync file.)

Answer: 
If you have problems with rsync, then you can use [reposync](https://linux.die.net/man/1/reposync). It is able to download all packages (or --newest-only| -n) from repo, configured in the system.
So final commands in script looks like:

```
/usr/bin/reposync --repoid=updates --download_path=/var/www/html/centos7/repo/updates --newest-only
/usr/bin/createrepo /var/www/html/centos7/repo/updates

```
you can try the following mirror which is supporting rsync as well

<http://mirror.nl.leaseweb.net/centos/>