summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/myth_mtc.py
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2016-01-15 19:23:33 (GMT)
committerBritney Fransen <brfransen@gmail.com>2016-01-15 19:23:33 (GMT)
commit384da89ebb8060c6c8f20aaffcf17e1feab56374 (patch)
treefe9a90f79c03233198ab4692d4142cbc98deea6e /abs/core/LinHES-system/myth_mtc.py
parentbd99523adf334481f5e09ed8d52ce82d121e1e65 (diff)
downloadlinhes_pkgbuild-384da89ebb8060c6c8f20aaffcf17e1feab56374.zip
linhes_pkgbuild-384da89ebb8060c6c8f20aaffcf17e1feab56374.tar.gz
linhes_pkgbuild-384da89ebb8060c6c8f20aaffcf17e1feab56374.tar.bz2
LinHES-system: myth_mtc.cron: don't run optimize on frontend_only systems
myth_mtc.py: add --noidlecheck option to not check forsystem idle. This is probably wise to only use for testing.
Diffstat (limited to 'abs/core/LinHES-system/myth_mtc.py')
-rwxr-xr-xabs/core/LinHES-system/myth_mtc.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/abs/core/LinHES-system/myth_mtc.py b/abs/core/LinHES-system/myth_mtc.py
index ee4fde2..e62592f 100755
--- a/abs/core/LinHES-system/myth_mtc.py
+++ b/abs/core/LinHES-system/myth_mtc.py
@@ -84,8 +84,20 @@ def bail_if_another_is_running():
def run_stuff():
print "\n%s" %get_timestamp()
- if not subprocess.call(["/usr/bin/python2", "/usr/LH/bin/idle.py"]):
- if ("--check_home" in sys.argv) or (len(sys.argv) == 1):
+
+ if (len(sys.argv) == 1) or ("--noidlecheck" in sys.argv) and (len(sys.argv) == 2):
+ runall = True
+ else:
+ runall = False
+
+ if ("--noidlecheck" in sys.argv):
+ print "No system idle check will be done."
+ idle = 0
+ else:
+ idle = subprocess.call(["/usr/bin/python2", "/usr/LH/bin/idle.py"])
+
+ if not idle:
+ if ("--check_home" in sys.argv) or runall:
print "\n#######################################"
print "\n%s Checking size of MythTV home" %(get_timestamp())
if not check_home():
@@ -93,7 +105,7 @@ def run_stuff():
else:
return True
- if ("--optimize" in sys.argv) or (len(sys.argv) == 1):
+ if ("--optimize" in sys.argv) or runall:
print "\n#######################################"
print "\n%s Running Optimize" %(get_timestamp())
if not optimize():
@@ -101,13 +113,13 @@ def run_stuff():
else:
return True
- if ("--backup" in sys.argv) or (len(sys.argv) == 1):
+ if ("--backup" in sys.argv) or runall:
print "\n#######################################"
print "\n%s Running Backup" %(get_timestamp())
if not os.system('/usr/LH/bin/lh_system_backup_job'):
print "\nFinished Backup"
- if ("--update" in sys.argv) or (len(sys.argv) == 1):
+ if ("--update" in sys.argv) or runall:
print "\n#######################################"
print "\n%s Running System Update" %(get_timestamp())
if not os.system('/usr/LH/bin/lh_system_host_update'):