diff options
author | Tom Ritter <tom@ritter.vg> | 2016-01-26 16:35:50 -0500 |
---|---|---|
committer | Tom Ritter <tom@ritter.vg> | 2016-01-26 16:35:50 -0500 |
commit | 892af69a33d4f0192bba1d3b0bc2ad688578a576 (patch) | |
tree | eb3b6b02320bd61328f10466927f2f499a468b75 | |
parent | 869de79cc6483f5583b2f9bddd08720d103c8bec (diff) |
Add day and daily at noon options
-rw-r--r-- | README | 4 | ||||
-rwxr-xr-x | jobs/EmailChecker.py | 1 | ||||
-rwxr-xr-x | jobs/JobBase.py | 2 | ||||
-rwxr-xr-x | main.py | 2 |
4 files changed, 7 insertions, 2 deletions
@@ -5,4 +5,6 @@ First edit the ... to your path * * * * * .../checker/main.py -m cron -c minute >/dev/null 2>&1 0 * * * * .../checker/main.py -m cron -c hour >/dev/null 2>&1 - + 0 0 * * * .../checker/main.py -m cron -c day >/dev/null 2>&1 + 0 0 12 * * .../checker/main.py -m cron -c day_noon >/dev/null 2>&1 + diff --git a/jobs/EmailChecker.py b/jobs/EmailChecker.py index ee6db77..7c61f01 100755 --- a/jobs/EmailChecker.py +++ b/jobs/EmailChecker.py @@ -3,6 +3,7 @@ import os import base64 import datetime +import logging import imaplib diff --git a/jobs/JobBase.py b/jobs/JobBase.py index a10bdeb..8ecdef4 100755 --- a/jobs/JobBase.py +++ b/jobs/JobBase.py @@ -8,6 +8,8 @@ import smtplib class JobFrequency: MINUTE = "minute" HOUR = "hour" + DAY = "day" + DAY_NOON = "day_noon" class JobBase: def __init__(self): @@ -22,7 +22,7 @@ from servers import StatusSite, PingSite if __name__ == "__main__": parser = argparse.ArgumentParser(description="Check your stuff.") parser.add_argument('-m', '--mode', choices=['daemon', 'cron'], required=True, help='The mode the application will run it.') - parser.add_argument('-c', '--crontime', choices=['minute', 'hour'], help='When in cron mode, the increment of cron.') + parser.add_argument('-c', '--crontime', choices=['minute', 'hour', 'day', 'day_noon'], help='When in cron mode, the increment of cron.') parser.add_argument('-v', action="store_true", help="Print verbose debugging information to stderr") args = parser.parse_args() |