[Spacewalk-list] Reposync behavior

Pierre Casenove pcasenove at gmail.com
Thu Feb 4 09:46:50 UTC 2016


Thanks for your answer. This way, each reposync is launched just after the
previous one, which can lead to overall shorter sync time.

Thanks.

Pierre

2016-02-04 9:23 GMT+01:00 Morten Middelthon <mm at lastfriday.com>:

> > On 03 Feb 2016, at 22:51, Pierre Casenove <pcasenove at gmail.com> wrote:
> >
> > Hello,
> > I have a spacewalk 2.4 server running on RHEL 6 Server, with PGSQL 8.4
> local database.
> > I have several repository syncs scheduled during the night.
> > I've noticed that since the 2.4 upgrade, if a first schedule is still
> running when a second is supposed to be launch, this second repository sync
> is simply skipped and never launched, even when schedule 1 is completed.
> > For exemple:
> > Centos 6 Base scheduled at 8pm
> > Centos 7 Base scheduled at 8.30pm
> > If centos 6 base hasn't been ended before 8.30pm, centos 7 Base is
> simply skipped.
> >
> > I'm pretty sure that before 2.4 upgrade, the second schedule was
> launched as soon as the first one ended.
> >
> > Am I totally wrong? If so, how can I configure spacewalk to be sure that
> each reposync are lunched each night?
>
> Hi,
>
> I experienced something similar to this on one of my spacewalk setups, so
> I stopped using the schedule via the web GUI and created my own
> cron-script. You still define the repo url and everything via the web gui,
> but not the schedule. I feel I have more control this way.
>
> This perl script will list all repositories with a defined repo URL, and
> then run reposync:
>
> ########## SCRIPT START ############
> #!/usr/bin/perl -w
>
> use strict;
> use warnings;
>
> my $cmd = "/usr/bin/spacewalk-repo-sync";
> my $options = "-t yum -c";
>
> # Get my repos
> my $repo_list = `$cmd -l |grep -v "No repo" |grep "^[a-z]"`;
> my @repos = split(/\n/, $repo_list);
>
> foreach my $repo (@repos) {
>         my @repo_info = split(/\|/, $repo);
>         my $channel = $repo_info[0];
>         chomp $channel;
>         $channel =~ s/ //g;
>         system("$cmd $options $channel");
> }
>
> ########## SCRIPT END ############
>
> And of course the cron job definition:
>
> /etc/cron.d/reposync
>
> MAILTO=<your-email-address at domain.example>
> 0 4 * * * root /<path-to-script>/reposync.pl
>
> with regards,
>
> Morten A. Middelthon
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20160204/e6b3b326/attachment.htm>


More information about the Spacewalk-list mailing list