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

avoid creating excluded directories

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: 5070
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 915dc4bb
......@@ -41,6 +41,7 @@
# (faster than based on checksum comparison [-c])
# 15/03/2013 V1.1 introduced additional [-o|--rsync-opts ARG] flags
# 16/03/2013 V1.1.1 corrected python specific issue
# 19/03/2013 V1.2 avoid creating excluded directories
#
# ============================================================================
#
......@@ -57,7 +58,7 @@ import csbackErrorCodes as eCodes
import csbacklog
import pidlock
__version__ = "V1.1.1"
__version__ = "V1.2"
__subversion__ = "$Id$"
__license__ = "GPLv2+"
__author__ = "Daniel Armbruster"
......@@ -364,8 +365,11 @@ def main(argv=None):
# first create directory structure tree remotly
try:
logger.getLogger().info("Update of directory structure tree ...")
subprocess.check_call(["rsync", '-rlpgoDu', '--filter=+ */', \
'--filter=- *', sourceDir, targetDir], shell=False)
rsyncCmd = ["rsync", '-rlpgoDu']
# add common excludes (passed as commandline args)
rsyncCmd.extend(["--exclude={0}".format(regex) for regex in regexes])
rsyncCmd.extend(['--filter=+ */', '--filter=- *', sourceDir, targetDir])
subprocess.check_call(rsyncCmd, shell=False)
except subprocess.CalledProcessError as err:
raise Error("rsync ERROR: {0}".format(err), \
eCodes.SCP_RsyncErrorDirTree)
......
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