Skip to content

Instantly share code, notes, and snippets.

@icot
Created May 24, 2016 07:41
Show Gist options
  • Save icot/42f23dea15454ca706f9682abfb0504a to your computer and use it in GitHub Desktop.
Save icot/42f23dea15454ca706f9682abfb0504a to your computer and use it in GitHub Desktop.
system_distro_sync
#!/bin/bash
# Script executed by the cronjob responsible for synchronize system
# packages with the ones reflected in the repository
# This file is generated by puppet don't touch it.
# It is possible to add -x <packageA> -x <packageB> to this file using the
# hiera variable, e.g
# osrepos_sync_exclude_packages:
# - openssh
# - cvmfs
# - kernel-*
#
# Based on Steve Traylen's distro_sync.sh on the osrepos module at:
# https://git.cern.ch/web/it-puppet-module-osrepos.git/blob/HEAD:/code/templates/distro_sync.sh.erb
# Modified to not exclude any yum repository in order to allow global
# system upgrades to force-happen
# Added modifications to the packages list generations to work with modern
# versions of Ruby as according to IMS-2173
if [ "$1" == "--noaction" ]; then
echo n | yum --skip-broken -x 'oracle-rdbms*' -x 'oracle-racrdbms*' -x 'oracle-crs*' distro-sync 2>&1 | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; }' | tee -a /var/log/distro_sync.log
else
yum --skip-broken -x 'oracle-rdbms*' -x 'oracle-racrdbms*' -x 'oracle-crs*' distro-sync -y 2>&1 | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; }' | tee -a /var/log/distro_sync.log
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment