Skip to main content

Posts

Showing posts from December, 2013

Subscription-manager

I am hopeful that someday I proclaim how great subscription-manager is and I can't believe we survived without it.  However, for now - I am slightly confused and wondering what the advantages are ;-) subscription-manager register subscription-manager auto-attach subscription-manager subscribe --auto

Adding External Repos to Spacewalk

I have a current objective that requires I take some risks with configuration setting on my Spacewalk system, which ends up being easier to start over with a new deployment.  And I had grown sick of the manual process adding a repo and associating it with a channel. cat << EOF >> /etc/rhn/spacewalk-common-channels-3rd-party.ini [epel-6] label    = epel-6 %(base_channel)s archs    = %(_x86_archs)s name     = EPEL 6 - (%(arch)s) base_channels = centos6-%(arch)s yumrepo_url = https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=%(arch)s [puppetlabs-products] label    = puppetlabs-products archs    = %(_x86_archs)s name     = Puppet Labs Products El 6 - (%(arch)s) base_channels = centos6-%(arch)s yumrepo_url = http://yum.puppetlabs.com/el/6/products/%(arch)s [puppetlabs-deps] label    = %(base_channel)s archs    = %(_x86_archs)s name     = Puppet Labs Dependencies El 6 - (%(arch)s) base_channels = centos6-%(arch)s yumrepo_url = http://yum.puppetlabs.com/el/6/depe

Update crontab from command line

I occasionally need to update the cron on a TON of hosts, and don't want to run crontab -e a TON of times.. crontab -l | grep 'chmod 666' == Add an entry to an existing crontab == if [ $? -ne 0 ] then   cat <(crontab -l) <(echo "* * * * * chmod 666 /u01/core/*") | crontab -   echo "NOTE: cron updated" else   echo "NOTE: cron was already updated" fi == Remove something from a crontab [root@dvgllpsmsapp13 ~]# crontab -l # Chmod something 0 0 * * * chmod 777 /tmp/test 0 0 * * * chown 777 /tmp/test [root@dvgllpsmsapp13 ~]# cat <(crontab -l | grep -vi chmod) | crontab - [root@dvgllpsmsapp13 ~]# crontab -l 0 0 * * * chown 777 /tmp/test [root@dvgllpsmsapp13 ~]#