From d5b5a4a5af947b32c9b517a1ac3711dc78929e35 Mon Sep 17 00:00:00 2001 From: coderick14 Date: Wed, 24 May 2017 14:08:52 +0530 Subject: Add cron module --- sbhs_server/settings.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sbhs_server') diff --git a/sbhs_server/settings.py b/sbhs_server/settings.py index 15dc8ae..7161f29 100644 --- a/sbhs_server/settings.py +++ b/sbhs_server/settings.py @@ -63,6 +63,7 @@ INSTALLED_APPS = ( #'yaksh', 'taggit', #'corsheaders' + 'django_crontab', 'account', 'myadmin', @@ -184,6 +185,10 @@ TEMPLATES = [ }, ] +CRONJOBS = [ + ('2 * * * *', 'maintenance.health_monitor.main', '>> /tmp/health_monitor.log'), +] + import warnings warnings.filterwarnings( 'ignore', r"DateTimeField .* received a naive datetime", @@ -270,6 +275,6 @@ print "No of machines online : ", len(online_mids) import sys print >>sys.stderr, online_mids[1:33] #srikant #srikant -#f = open('/tmp/online_mids', 'w') +#f = open(os.path.join(BASE_DIR, 'maintenance/online_mids.txt'), 'w') #f.write(online_mids) #f.close() -- cgit