Commit 8f606f27 authored by Daniel Armbruster's avatar Daniel Armbruster Committed by thomas.forbriger
Browse files

added days option to mail section

This is a legacy commit from before 2015-05-18.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 5072
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent c54e120f
......@@ -53,6 +53,7 @@
# 15/03/2013 V1.1.3 secure copy option - optional lock of directories; exclude
# .lock and checksumfile.result files from rsync copy
# process
# 18/03/2013 V1.1.4 added day option to mail section
#
# =============================================================================
"""
......@@ -77,7 +78,7 @@ else:
sys.stderr.write("csback2cron: Incompatible python version.\n")
import csbackErrorCodes as eCodes
__version__ = "V1.1.3"
__version__ = "V1.1.4"
__subversion__ = "$Id$"
__license__ = "GPLv2+"
__author__ = "Daniel Armbruster"
......@@ -177,6 +178,8 @@ class MailConverter(Converter):
def convertDict(self):
self.line = \
self.sectionDict['cronexpr']+' '+self.scriptLocation+'csbackntfy'
if self.sectionDict['daysexclude']:
self.line += ' -D '+self.sectionDict['daysexclude']
if self.sectionDict['logging']:
self.line += ' -l'
self.line += ' -H '+self.sectionDict['host']+' -P '+ \
......@@ -392,10 +395,12 @@ class Processor():
self.mail['port'] = self.config.get('mail', 'port').strip()
self.mail['username'] = self.config.get('mail', 'username').strip()
self.mail['password'] = self.config.get('mail', 'password').strip()
self.mail['logging'] = False
if self.config.has_option('mail', 'logging'):
self.mail['logging'] = self.config.getboolean('mail', 'logging')
else:
self.mail['logging'] = False
self.mail['daysexclude'] = None
if self.config.has_option('mail', 'days'):
self.mail['daysexclude'] = self.config.get('mail', 'days')
except NoOptionError as err:
raise Error("{0}".format(err.message), eCodes.CRON_MissingOption)
except ValueError:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment