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?

Posted on

  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 ~~~

# 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
#    General Public License <> 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)