Commit f91743a7 authored by Daniel Armbruster's avatar Daniel Armbruster Committed by thomas.forbriger

merge feature branch back into trunk

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: 5047
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 72cd9b68
......@@ -33,7 +33,7 @@ TUN_INTERFACE=tun0
# approx. 80% of 256 kBit/second
BWLIMIT=32
EXCLUDE="--exclude='.lock'"
BFO_BASEDIR=/data/BFO
BFO_BASEDIR=/media/BFO_archive
LSDF_BASEDIR=\
gpi-seis@gpilsdf.gpi.uni-karlsruhe.de:/gpfs/lsdf/gpi/GPI/SEIS/projects/BFO
# NOTE: If adding an additional data directory an exclude pattern must be added,
......@@ -98,7 +98,7 @@ source $HOME/.keychain/$HOSTNAME-sh
for i in ${!DATADIRS[*]}
do
# copy data (compressed)
${RSYNC} -q -z -a --protocol=29 --bwlimit ${BWLIMIT} ${EXCLUDE} \
${RSYNC} -nv -z -a --protocol=29 --bwlimit ${BWLIMIT} ${EXCLUDE} \
${EXCLUDE_PATTERNS[$i]} ${BFO_BASEDIR}/${DATADIRS[$i]} \
${LSDF_BASEDIR}/${DATADIRS[$i]}
......
......@@ -24,10 +24,14 @@
# 15/01/2012 V0.1 Daniel Armbruster
# 16/01/2012 V0.2 added package rule
# 28/02/2012 V0.3 smaller modifications - added csbackobs.py
# 27/04/2012 V0.4 added lsYears.py
# 27/04/2012 V0.4 added lsYears.py - removed with V0.5 (deprecated)
# 13/02/2013 V0.5 added csbackresc.py and ssh/scp specific checks
# 14/02/2013 V0.6 added csclean.sh
# 28/02/2013 V0.7 added csbackscp.py
#
# ----------------------------------------------------------------------------
PROGRAMS=csback2cron.py csbackntfy.py csbackgen.py csbackchk.py csbackobs.py \
lsYears.py
csbackresc.py csbackscp.py csclean.sh
.PHONY: all
all: install doc
......@@ -45,11 +49,14 @@ CRON=$(shell ps -ef | grep -v grep | grep -cw cron)
SYSLOGNG=$(shell ps -ef | grep -v grep | grep -cw syslog)
LOGROTATE=$(shell if [ -d /etc/logrotate.d/ ]; then echo logrotate; fi)
PYTHON=$(shell env which python)
SSH=$(shell env which ssh)
SCP=$(shell env which scp)
# ----------------------------------------------------------------------------
.PHONY: clean
clean:
/bin/rm -rvf $(addprefix $(LOCBINDIR)/,$(patsubst %.py,%,$(PROGRAMS)))
/bin/rm -rvf $(addprefix $(LOCBINDIR)/,$(patsubst %.sh,%,$(PROGRAMS)))
$(MAKE) -C doc clean
# ----------------------------------------------------------------------------
......@@ -60,7 +67,7 @@ CHECKPROG=$(if $($(1)),,$(error ERROR: missing program $(1)))
CHECKPROGS=$(foreach prog,$(1),$(call CHECKPROG,$(prog)))
$(call CHECKVARS, LOCBINDIR)
$(call CHECKPROGS, RSYNC CRON SYSLOGNG LOGROTATE PYTHON)
$(call CHECKPROGS, RSYNC CRON SYSLOGNG LOGROTATE PYTHON SSH SCP)
# ----------------------------------------------------------------------------
PWD=$(shell env pwd)
......@@ -72,7 +79,13 @@ $(LOCBINDIR)/%: %.py
ln -fs $(addprefix $(PWD)/,$<) $@
chmod +x $(addprefix $(PWD)/,$<)
installscripts: $(addprefix $(LOCBINDIR)/, $(patsubst %.py,%,$(PROGRAMS)))
$(LOCBINDIR)/%: %.sh
mkdir -pv $(LOCBINDIR)
ln -fs $(addprefix $(PWD)/,$<) $@
chmod +x $(addprefix $(PWD)/,$<)
installscripts: $(addprefix $(LOCBINDIR)/, $(patsubst %.py,%,$(PROGRAMS)) \
$(patsubst %.sh,%,$(PROGRAMS)))
# ----------------------------------------------------------------------------
pdfdoc:
......
this is <README>
===============================================================================
csback - A toolkit written in python to manage backups
csback - A toolkit written in python to manage backups.
--------------------------
$Id$
===============================================================================
......@@ -39,7 +39,7 @@ documentation which comes along with this package.
Documentation:
----
This package comes along with a pdf documentation which is located in
doc/manuals.pdf.
doc/manual.pdf.
----- END OF README -----
This diff is collapsed.
#!/usr/bin/env python
# This is <csbackErrorCodes.py>
# ----------------------------------------------------------------------------
# $Id$
#
# Copyright (c) 2013 by Daniel Armbruster (BFO Schiltach)
#
# Purpose: Collection csback error codes.
#
# ----
# This file is part of csback.
#
# csback is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# csback is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with csback. If not, see <http://www.gnu.org/licenses/>.
# ----
#
# REVISIONS and CHANGES
# 23/02/2013 V1.0 Daniel Armbruster
#
# ============================================================================
#
# ----------------------------------------------------------------------------
# global error codes (used by several csback tools and modules)
# ----------------------------------------------------------------------------
# general usage error while using program
GLOBAL_UsageError=1
# unhandled commandline option chosen
GLOBAL_UnhandledOption=2
# program called with invalid commandline arguments
GLOBAL_InvalidCmdlineArgs=3
# unhandled exception caught
GLOBAL_UnhandledException=9
# ----------------------------------------------------------------------------
# csbackntfy specific error codes
# ----------------------------------------------------------------------------
# an IOError occurred while parsing a log file
NTFY_IOError=101
# invalid email address
NTFY_InvalidMailAdd=102
# ----------------------------------------------------------------------------
# csback2cron specific error codes
# ----------------------------------------------------------------------------
# error while parsing CONFIGFILE
CRON_ParsingError=201
# missing required option in section
CRON_MissingOption=202
# argument error while parsing CONFIGFILE
CRON_ArgError=203
# undefined section in CONFIGFILE
CRON_UndefinedSection=204
# already existent crontab file
CRON_ExistentCrontab=205
# ----------------------------------------------------------------------------
# csbackresc specific error codes
# ----------------------------------------------------------------------------
# exit status if tag is unkown
RESC_UnknownTag=302
# exit status if ID is missing
RESC_MissingId=303
# exit status if entry property missing
RESC_MissingProberty=304
# exit status for ssh problems
RESC_Ssh=305
# exit status for scp problems
RESC_Scp=306
# exit status for status file problems
RESC_WriteStatus=307
# exit status if directory is not available
RESC_InvalidDir=308
# exit status if file is not available
RESC_InvalidFile=309
# exit status if arbitrary file error
RESC_FileIo=310
# ----------------------------------------------------------------------------
# csbackobs specific error codes
# ----------------------------------------------------------------------------
# error while executing commands
OBS_WhileExecutingCmds=401
# ----------------------------------------------------------------------------
# csbackchk specific error codes
# ----------------------------------------------------------------------------
# different directory structure of SOURCEPATH and PATH
CHK_DifferentDirStructure=501
# PATH does not contain a checksum file
CHK_MissingChecksumFile=502
# ----------------------------------------------------------------------------
# csbackgen specific error codes
# ----------------------------------------------------------------------------
# invalid hash function in use
GEN_InvalidHashFunction=601
# ----------------------------------------------------------------------------
# csbackscp specific error codes
# ----------------------------------------------------------------------------
# error while executing rsync
SCP_RsyncError=701
# error while copying files with selected command
SCP_CopyError=702
# source directory and target directory are equal
SCP_SourceDirEqualTargetDir=703
# error while creating/updating directory tree with rsync remotely
SCP_RsyncErrorDirTree=704
# error while executing find command
SCP_FindError=705
# ----------------------------------------------------------------------------
# pidlock module specific error codes
# ----------------------------------------------------------------------------
# if directory to lock is allready locked.
LOCK_DirAlreadyLocked=801
# if lockking mechanism is not able to hold the lock anymore.
LOCK_CanNotHoldLonger=802
# while releasing a lock an invalid PID was passed
LOCK_InvalidPID=803
# unable to create a lock file
LOCK_UnableToCreate=804
# unable to remove lockfile of inactive process
LOCK_UnableToRemove=805
# timeout has expired while waiting for active process
LOCK_TimeOutExpired=806
# missing lock file
LOCK_LockFileMissing=807
# lock of directory already announced by process with same PID
LOCK_SamePidActive=808
# ----------------------------------------------------------------------------
# csfile module specific error codes
# ----------------------------------------------------------------------------
# while computing the checksum of a data file an error occurred
CSFILE_UnableToReadDataFile=901
# unable to handle function argument -> leads to a TypeError
CSFILE_InvalidType=902
# unable to append new checksum lines to checksum file
CSFILE_UnableToAppend=903
# list passed does contain elements which are not of type CsLine
CSFILE_InvalidDataType=904
# directory path does not exist
CSFILE_DirNotExistent=905
# reading the checksum file was not successful
CSFILE_UnableToReadChecksumFile=906
# error while creating new checksum file
CSFILE_UnableToCreateChecksumFile=907
# checksum file does not contain an entry for file
CSFILE_NoEntryAvail=908
# while checking - file does not exist
CSFILE_DataFileNotExistent=909
# error while collecting subdirectories
CSFILE_CollectingSubDirs=910
# TypeError while processing time exclusion for data files
CSFILE_TimeProcessingTypeError=911
# OverflowError while processing time exclusion for data files. Given time is
# out of range
CSFILE_TimeProcessingOverflowError=912
# ----- END OF csbackErrorCodes.py -----
......@@ -35,6 +35,8 @@
# own checksumfile.
# 11/01/2012 V0.4 pid lockfile handler ability added
# 14/07/2012 V0.4.1 provide more information in ERROR log messages
# 24/02/2013 V0.5 make use of reimplemented directory lock module
# 28/02/2013 V0.6 improve error handling; use error codes
#
# =============================================================================
......@@ -46,48 +48,30 @@ import logging
import csfile
import csbacklog
import pidlock
import csbackErrorCodes as eCodes
__version__ = "V0.4.1"
__version__ = "V0.6"
__subversion__ = "$Id$"
__license__ = "GPLv2"
__license__ = "GPLv2+"
__author__ = "Daniel Armbruster"
__copyright__ = "Copyright (c) 2012 by Daniel Armbruster"
# -----------------------------------------------------------------------------
class Error(Exception):
def __init__(self, line, msg):
self.line = str(line)
self.msg = msg
def display(self):
sys.stderr.write("csbackchk (ERROR): " + self.msg + "\n")
sys.stderr.write("triggered in line: " + self.line + "\n")
class Usage(Error):
def display(self):
usage_text = "Version: "+__version__+"\nLicense: "+__license__+ \
# variables
# ---------
USAGE_TEXT = "Version: "+__version__+"\nLicense: "+__license__+ \
"\n"+__subversion__+"\nAuthor: "+__author__+ """
Usage: csbackchk [-v|--verbose] [-e REGEX [-e REGEX [...]]]
[-R|--notrecursive] [-d|--debug] [-f|--followlinks]
[-t|--tolerant] [-l|--logging] [-L|--lock] [SOURCEPATH] PATH
or: csbackchk -h|--help\n"""
sys.stderr.write("csbackchk [line "+self.line+"]: "+self.msg+"\n")
sys.stderr.write(usage_text)
# -----------------------------------------------------------------------------
def help():
"""
Printing helptext to stdout.
"""
help_text = "Version: "+__version__+"\nLicense: "+__license__+"\n"+ \
__subversion__+"\nAuthor: "+__author__+"""
Usage: csbackchk [-v|--verbose] [-e REGEX [-e REGEX [...]]]
[-R|--notrecursive] [-d|--debug] [-f|--followlinks]
[-t|--tolerant] [-l|--logging] [-L|--lock] [SOURCEPATH] PATH
or: csbackchk -h|--help
help_text = USAGE_TEXT+"""
-------------------------------------------------------------------------------
-v|--verbose Be verbose.
-h|--help Display this help.
......@@ -108,7 +92,8 @@ def help():
case csbackchk was run simultaneously with other csback
processes working in the same directory. Setting this
option avoids checksumfile access problems which might
occur.
occur. If not enabeled csbackchk will not care about locked
directories.
SOURCEPATH Optional sourcepath for comparison with files backed up in
PATH. PATH and its subdirectories (if option '-R' had not
been selected) must contain the csback checksumfile(s).
......@@ -120,12 +105,33 @@ def help():
"""
sys.stdout.write(help_text)
# -----------------------------------------------------------------------------
# exception handling
# ---------
class Error(Exception):
def __init__(self, msg, errorCode):
self.msg = str(msg)
self.errorCode = int(errorCode)
def __str__(self):
return "csbackchk (ERROR): {0} (CODE {1}).\n".format(self.msg, \
self.errorCode)
class Usage(Error):
def __str__(self):
return "csbackchk (ERROR): {0} (CODE {1}).\n".format( \
self.msg, self.errorCode)+USAGE_TEXT
# -----------------------------------------------------------------------------
def main(argv=None):
# configure logger
logger = csbacklog.CsbackLog('csbackchk')
console = logging.StreamHandler()
console = logging.StreamHandler(stream=sys.stdout)
console.setFormatter(logging.Formatter( \
'%(name)-8s [%(lineno)d]: %(levelname)-8s %(message)s'))
......@@ -138,7 +144,7 @@ def main(argv=None):
"notrecursive", "debug", "followlinks", "tolerant", "logging", \
"lock"])
except getopt.GetoptError as err:
raise Usage(141,err.msg)
raise Usage(err.msg, eCodes.GLOBAL_UsageError)
verbose = False
debugMode = False
notRecursive = False
......@@ -170,7 +176,7 @@ def main(argv=None):
elif opt in ("-L", "--lock"):
pidLock = True
else:
raise Usage(173,"Unhandled option chosen.")
raise Usage("Unhandled option chosen.", eCodes.GLOBAL_UnhandledOption)
if verbose or debugMode:
logger.addHandler(console)
......@@ -187,7 +193,8 @@ def main(argv=None):
inputpath = str(args[1]).rstrip(os.sep)+os.sep
inputDirs = [inputpath]
else:
raise Usage(190,"Invalid argument(s).")
raise Usage("Invalid commandline arguments.", \
eCodes.GLOBAL_InvalidCmdlineArgs)
# major part
logger.getLogger().debug("Collecting subdirectories ...")
......@@ -203,8 +210,9 @@ def main(argv=None):
csfile.getSubDirectories(inputpath, regexes, followlinks))
if len(sourceDirs) != len(inputDirs):
raise Error(206, \
"Directory structure of inputpath and sourcepath different.")
raise Error( \
"Directory structure of inputpath and sourcepath different.", \
eCodes.CHK_DifferentDirStructure)
# create tuples of input directory path - source directory path
paths = list(zip(inputDirs, sourceDirs))
......@@ -217,18 +225,14 @@ def main(argv=None):
"Check of files in '{0}' with checksumfile in '{1}'".format(path[1], \
path[0]))
if not csfile.hasCsFile(path[0]):
raise Error(220,"PATH '{0}' does not contain a checksumfile.".format( \
path[0]))
lock = pidlock.PidLocker(path[0])
raise Error("PATH '{0}' does not contain a checksumfile.".format( \
path[0]), eCodes.CHK_MissingChecksumFile)
checksumfile = csfile.CsFile(path[0], path[1], followlinks=followlinks)
if lock.lockValid():
raise pidlock.PidLockError(-1, \
"Directory '{0}' locked.".format(path[0]))
elif pidLock:
lock.announce(os.getpid())
if pidLock:
lock = pidlock.Lock(path[0])
checksumfile.read()
checksumfile.check(regexes, beTolerant)
lock.cancel(os.getpid())
lock.release(os.getpid())
else:
checksumfile.read()
checksumfile.check(regexes, beTolerant)
......@@ -236,20 +240,20 @@ def main(argv=None):
"Check of files in '{0}' finished.".format(path[1]))
except Usage as err:
err.display()
return 2
except pidlock.PidLockError as err:
logger.getLogger().error("{0}".format(err.msg))
err.display()
return 2
sys.stderr.write(str(err))
return err.errorCode
except pidlock.LockError as err:
logger.getLogger().error("{0}".format(err))
sys.stderr.write(str(err))
return err.errorCode
except Error as err:
logger.getLogger().error("message: %s [line %s]", err.msg, err.line)
err.display()
return 2
logger.getLogger().error("message: %s [CODE %s]", err.msg, err.errorCode)
sys.stderr.write(str(err))
return err.errorCode
except csfile.CsFileError as err:
logger.getLogger().error("message: %s [line %s]", err.msg, err.line)
err.display()
return 2
logger.getLogger().error("message: %s [CODE %s]", err.msg, err.errorCode)
sys.stderr.write(str(err))
return err.errorCode
else:
logger.getLogger().info("Checks performed.")
return 0
......
......@@ -35,6 +35,8 @@
# 10/01/2012 V0.3 introduced --hash flag
# 11/01/2012 V0.4 pid lockfile handler ability added
# 17/01/2012 V0.5 implemented file selection regarding time
# 24/02/2013 V0.6 make use of reimplemented directory lock module
# 28/02/2013 V0.7 improve error handling; use error codes
#
# =============================================================================
......@@ -47,27 +49,18 @@ import logging
import csfile
import csbacklog
import pidlock
import csbackErrorCodes as eCodes
__version__ = "V0.5"
__version__ = "V0.7"
__subversion__ = "$Id$"
__license__ = "GPLv2"
__license__ = "GPLv2+"
__author__ = "Daniel Armbruster"
__copyright__ = "Copyright (c) 2012 by Daniel Armbruster"
# -----------------------------------------------------------------------------
class Error(Exception):
def __init__(self, msg):
self.msg = msg
def display(self):
sys.stderr.write("csbackgen (ERROR): " + self.msg + "\n")
class Usage(Error):
def display(self):
usage_text = "Version: "+__version__+"\nLicense: "+__license__+ \
# variables
# ---------
USAGE_TEXT = "Version: "+__version__+"\nLicense: "+__license__+ \
"\n"+__subversion__+"\nAuthor: "+__author__+ """
Usage: csbackgen [-v|--verbose] [-e REGEX [-e REGEX [...]]]
[-R|--notrecursive] [-d|--debug] [-f|--followlinks]
......@@ -75,22 +68,15 @@ class Usage(Error):
[-L|--lock] [-D|--daystart] [--atime N] [--mtime N]
[--ctime N] [--amin N] [--mmin N] [--cmin N] PATH
or: csbackgen -h|--help\n"""
sys.stderr.write("csbackgen: " + self.msg + "\n")
sys.stderr.write(usage_text)
VALIDHASHES = ['sha224', 'sha256', 'sha384', 'sha512']
# -----------------------------------------------------------------------------
def help():
"""
Printing helptext to stdout.
"""
help_text = "Version: "+__version__+"\nLicense: "+__license__+"\n"+ \
__subversion__+"\nAuthor: "+__author__+"""
Usage: csbackgen [-v|--verbose] [-e REGEX [-e REGEX [...]]]
[-R|--notrecursive] [-d|--debug] [-f|--followlinks]
[-t|--target ROOTDIR] [-l|--logging] [-H|--hash ARG]
[-L|--lock] [-D|--daystart] [--atime N] [--mtime N]
[--ctime N] [--amin N] [--mmin N] [--cmin N] PATH
or: csbackgen -h|--help
help_text = USAGE_TEXT+"""
-------------------------------------------------------------------------------
-v|--verbose Be verbose.
-h|--help Display this help.
......@@ -113,7 +99,8 @@ def help():
case csbackgen was run simultaneously with other csback
processes working in the same directory. Setting this
option avoids checksumfile access problems which might
occur.
occur. If not enabeled csbackchk will not care about
locked directories.
-D|--daystart Measure times (for --amin, --atime, --cmin, --ctime,
--mmin, and --mtime) from the beginning of today rather
than from 24 hours ago.
......@@ -160,15 +147,32 @@ excluded in contrast to the Unix find command where files were included.\n"""
sys.stdout.write(help_text)
# -----------------------------------------------------------------------------
# global variables
VALIDHASHES = ['sha224', 'sha256', 'sha384', 'sha512']
# exception handling
# ---------
class Error(Exception):
def __init__(self, msg, errorCode):
self.msg = str(msg)
self.errorCode = int(errorCode)
def __str__(self):
return "csbackgen (ERROR): {0} (CODE {1}).\n".format(self.msg, \
self.errorCode)
class Usage(Error):
def __str__(self):
return "csbackgen (ERROR): {0} (CODE {1}).\n".format( \
self.msg, self.errorCode)+USAGE_TEXT
# -----------------------------------------------------------------------------
def main(argv=None):
# configure logger
logger = csbacklog.CsbackLog('csbackgen')
console = logging.StreamHandler()
console = logging.StreamHandler(stream=sys.stdout)
console.setFormatter(logging.Formatter( \
'%(name)-8s [%(lineno)d]: %(levelname)-8s %(message)s'))
......@@ -181,7 +185,7 @@ def main(argv=None):
"logging", "hash=", "lock", "daystart", "amin=", "atime=", \
"cmin=", "ctime=", "mmin=", "mtime="])
except getopt.GetoptError as err:
raise Usage(err.msg)
raise Usage(err.msg, eCodes.GLOBAL_UsageError)
verbose = False
debugMode = False
notRecursive = False
......@@ -218,7 +222,8 @@ def main(argv=None):
if arg in VALIDHASHES:
hashfunc = arg
else:
raise Usage("Invalid argument (hash).")
raise Usage("Invalid argument (hash).", \
eCodes.GEN_InvalidHashFunction)
elif opt in ("-L", "--lock"):
pidLock = True
elif opt in ("-D", "--daystart"):
......@@ -242,7 +247,7 @@ def main(argv=None):
timeDict['hasmTimes'] = True
timeDict['mtime'].append(arg)
else:
raise Usage("Unhandled option chosen.")
raise Usage("Unhandled option chosen.", eCodes.GLOBAL_UnhandledOption)
if verbose or debugMode:
logger.addHandler(console)
......@@ -251,9 +256,11 @@ def main(argv=None):
if 1 == len(args):
srcpath = str(args[0]).rstrip(os.sep)+os.sep
else:
raise Usage("Invalid argument.")
raise Usage("Invalid commandline arguments.", \
eCodes.GLOBAL_InvalidCmdlineArgs)
if not os.path.isdir(srcpath):
raise Usage("PATH not a valid directory.")
raise Usage("PATH not a valid directory.", \
eCodes.GLOBAL_InvalidCmdlineArgs)
# major part
logger.getLogger().debug("Start collecting subdirectories ...")
......@@ -267,7 +274,8 @@ def main(argv=None):
else:
targetdirs = [targetDirectory]
if not os.path.isdir(targetDirectory):
raise Usage("Target directory not a valid directory.")
raise Usage("Target directory not a valid directory.", \
eCodes.GLOBAL_InvalidCmdlineArgs)
# generate checksumfiles for subdirectories (recursive mode)
# so collect all available subdirectories here (excluding subdirectories)
if not notRecursive:
......@@ -291,35 +299,33 @@ def main(argv=None):
logger.getLogger().info( \
"Updating checksumfile in '{0}' with files from '{1}' ...".format( \
path[0], path[1]))
lock = pidlock.PidLocker(path[0])
checksumfile = csfile.CsFile(path[0], path[1], hashfunc=hashfunc, \
timeDict=timeDict, followlinks=followlinks)
# lock directory currently working in (use pid locking module) if possible
# - else terminate raising an exception
if lock.lockValid():
raise pidlock.PidLockError(-1, \
"Directory '{0}' locked.".format(path[0]))
elif pidLock:
lock.announce(os.getpid())
if pidLock:
lock = pidlock.Lock(path[0])
checksumfile.update(regexes)
lock.cancel(os.getpid())
lock.release(os.getpid())
else:
checksumfile.update(regexes)
logger.getLogger().info( \
"Finished updating checksumfile in '{0}'.".format(path[0]))
except Usage as err:
err.display()
return 2
except pidlock.PidLockError as err:
logger.getLogger().critical("{0}".format(err.msg))
err.display()
return 2
sys.stderr.write(str(err))
return err.errorCode
except pidlock.LockError as err:
logger.getLogger().error("{0}".format(err))
sys.stderr.write(str(err))
return err.errorCode
except Error as err:
logger.getLogger().error("message: %s [CODE %s]", err.msg, err.errorCode)
sys.stderr.write(str(err))
return err.errorCode
except csfile.CsFileError as err:
logger.getLogger().error("{0}".format(err.msg))
err.display()
return 2
logger.getLogger().error("message: %s [CODE %s]", err.msg, err.errorCode)
sys.stderr.write(str(err))
return err.errorCode
else:
logger.getLogger().info("Checksumfile(s) updated.")
return 0
......
......@@ -32,6 +32,8 @@
# REVISIONS and CHANGES
# 05/01/2012 V0.1 Daniel Armbruster
# 29/01/2012 V0.2 introduced result logging class
# 24/02/2013 V0.3 smaller adjustments
# 24/02/2013 V0.3.1 correction
#
# =============================================================================
......@@ -55,7 +57,7 @@ import logging.handlers
import csfile
import socket
__version__ = "V0.1"
__version__ = "V0.3"
__subversion__ = "$Id$"