My environment does not see a lot of general maintenance or attention in particular ways. I will occasionally find something that is either causing us grief, or about to...
One of those items is the size of my Satellite Database. The size is now an issue as I hope to upgrade to Red Hat Satellite 5.6 and migrate to Postgres in the process (yeah!).
Some folks have recommended:
* remove unused channels (seems logical enough)
* remove unused/older snapshots
I'm fairly certain that nobody else in my environment knows or realizes that snapshots even exist, let alone why they are advantageous. Therefore, I intend to truncate the snapshots to only include those created in the last 4 months.
#!/usr/bin/expect -f
#
# Expect and autoexpect were both written by Don Libes, NIST.
#
set force_conservative 0 ;# set to 1 to force conservative mode even if
;# script wasn't run conservatively originally
if {$force_conservative} {
set send_slow {1 .1}
proc send {ignore arg} {
sleep .1
exp_send -s -- $arg
}
}
if { $argc != 1 } {
puts "\r"
puts "ERROR: Unexpected parameters.\r"
puts "$argv0 <SystemUID> \r"
exit
}
set CLIENTNAME [lindex $argv 0]
set timeout -1
spawn $env(SHELL)
match_max 100000
expect -exact "\[root@rhnsat01 ~\]# "
send -- "sw-system-snapshot --delete --system-id ${CLIENTNAME} --start-date=20100901000000 --end-date \$(date -d \"-4 months\" \"+%Y%m%d0000\")\r"
expect "Red Hat Network username: "
send -- "satadmin\r"
expect -exact "satadmin\r
Red Hat Network password: "
send -- "<redacted>\r"
expect -exact "\r
\[root@rhnsat01 ~\]# "
send -- "exit\r"
expect eof
One of those items is the size of my Satellite Database. The size is now an issue as I hope to upgrade to Red Hat Satellite 5.6 and migrate to Postgres in the process (yeah!).
Some folks have recommended:
* remove unused channels (seems logical enough)
* remove unused/older snapshots
I'm fairly certain that nobody else in my environment knows or realizes that snapshots even exist, let alone why they are advantageous. Therefore, I intend to truncate the snapshots to only include those created in the last 4 months.
#!/usr/bin/expect -f
#
# Expect and autoexpect were both written by Don Libes, NIST.
#
set force_conservative 0 ;# set to 1 to force conservative mode even if
;# script wasn't run conservatively originally
if {$force_conservative} {
set send_slow {1 .1}
proc send {ignore arg} {
sleep .1
exp_send -s -- $arg
}
}
if { $argc != 1 } {
puts "\r"
puts "ERROR: Unexpected parameters.\r"
puts "$argv0 <SystemUID> \r"
exit
}
set CLIENTNAME [lindex $argv 0]
set timeout -1
spawn $env(SHELL)
match_max 100000
expect -exact "\[root@rhnsat01 ~\]# "
send -- "sw-system-snapshot --delete --system-id ${CLIENTNAME} --start-date=20100901000000 --end-date \$(date -d \"-4 months\" \"+%Y%m%d0000\")\r"
expect "Red Hat Network username: "
send -- "satadmin\r"
expect -exact "satadmin\r
Red Hat Network password: "
send -- "<redacted>\r"
expect -exact "\r
\[root@rhnsat01 ~\]# "
send -- "exit\r"
expect eof
Comments
Post a Comment