Forget what you have synced? Want to sync something, but can't come up with the name easily or getting a listing is too slow?
Hi Team!
In my environment, I am always testing and just generally playing with Satellite. I am always forgetting what I had synced at any given time.
To that end, I wrote the small script below. Its not very elegant, but it works for me :) I just drop it in /etc/cron.daily and the output files are generally current.
In addition to quickly being able to see what channel I have synced just by cat /tmp/synced.out, it also very easy to # grep <name of channel> /tmp/not_synced.out, grab what you are looking for in the buffer, followed by #satellite-sync -c <name of channel>
Of course, don't forget to # chmod +x <name of script> :)
~~~ script ~~~
#!/bin/bash
# synced v0.1.0rc1c last mod 2013/01/23
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License <gnu.org/licenses/gpl.html> for more details.
#-------------------------------------------------------------------------------
# So much still to do ... Suggestions always welcome
# I keep it in /etc/cron.daily
satellite-sync --list-channels > /tmp/satchannels.out
## this gives you channels that are synced
awk '$2 ~ /^p$/' /tmp/satchannels.out > /tmp/synced.out
## this gives you channels that are *not* synced
awk '$2 ~ //' /tmp/satchannels.out > /tmp/not_synced.out
~~~ /script ~~~
Do you have any scripts that you wrote to make routine tasks easier? Please do share them!
Kind Regards,
Jim Lyle, RHCE
Technical Account Manager(TAM)
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
