Yum/plugins
Izvor: HrOpenWiki
Generiranje naredbe za uklanjanje svih instaliranih rpm paketa do određenog datuma iz loga Yum
Korištenje: python yum-rm.py [datum] < /var/log/yum.log
Primjer: python yum-rm.py "Dec 21" < /var/log/yum.log
Izvorni kod(yum-rm.py):
import re, sys if len(sys.argv) != 2: print "Koristenje: python yum-rm.py [datum] < /var/log/yum.log" sys.exit() sys.stdout.write("\nyum remove ") while True: try: x = raw_input() except Exception: break data = re.findall("%s \d\d:\d\d:\d\d Installed: (.*)" % (sys.argv[1]), x) if data and len(data)>0: sys.stdout.write(" %s" % (data[0])) sys.stdout.write("\n")