I'm running CentOS7 and I would like to know how to set up a Bi-Weekly cronjob to download update packages for CentOS6 and CentOS7 (os,extras,updates) from the fastest mirror and place them in the respective folders






And if its possible to tell it to only download new packages from the last update performed

I'm not a whiz at bash yet but working on it

EDIT: so I think the easiest way would be to set an empty folder as systemroot for yum, then tell yum to downloadonly to a folder created right beforehand with

mkdir -p /home/User/$(date +%M)/Centos6/

mkdir -p /home/User/$(date +%M)/Centos7/

so that way only the last downloaded packages get excluded from the update? Would that work? I just wouldn't know how to separate the base, extras, and updates folders.

I'm trying to stay away from rsync because that seems to freeze constantly because the speed slows down to a crawl on my connection. Yum is better with the fastestmirror plugin that'll automatically switch to another mirror if it gets to slow. That way I don't have to give it constant attention.

  • Why do you think some other (less efficient) download method would work better than rsync? – Satō Katsura May 25 '17 at 18:21
  • When trying rsync, it slows to a crawl so much that is basically freezes. I constantly have to monitor it and Ctrl+c and try again when it does. Unless you know how to get rsync to use a list of mirrors like yum does, that's basically my only option. – KenPC May 25 '17 at 18:26
  • Do you mean rpm packages? If so, you should check reposync command. You can synchronize every other yum repo, defined in /etc/yum/repos.d directory, to your local storage. – LittleSmurfie May 25 '17 at 18:41
  • yes, just the rpm's . Would that allow me to also separate the os, extras, and updates packages into different folders? – KenPC May 25 '17 at 18:54

Your Answer

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

Browse other questions tagged or ask your own question.