Linux

Exclude certain packages from yum-cron (but not from yum)

This is a solution for how you can exclude certain packages being updated when using yum-cron. Docker and kernel are packages I would like to exclude from yum-cron. The solution to this is to modify the /etc/yum/yum-cron.conf file adding this to the [base] section RHEL7/Centos7 [base] … exclude = kernel* docker* On RHEL6/Centos6 you can […]

Read More
Linux

Hammer script to get output from Job by id

This is a simple script I use to export the details from a Job run in Red Hat Satellite 6.2 using hammer from the console. #!/bin/bash # Redhat Satellite Job query by id using hammer if [ $1 -eq $1 ] 2>/dev/null; then # get hosts run by ID JOBHOSTS=$(hammer job-invocation info –id $1 | […]

Read More
Linux

Print last Sunday of month

This is a bash oneliner to get the date of the last Sunday in the month, nice to have if you cannot figure out an easy solution in crontab. # cal -m | awk ‘{print $7}’ | grep -E ‘[0-9]’ | tail -n 1 28 or only using awk # cal -m | awk ‘$7!=””{l=$7} […]

Read More