From c3b066a6d74958c56d6a2bc098ae61cd3a24e5eb Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 25 Aug 2019 21:14:04 +0500 Subject: [PATCH] WP Staging: Exclude some folders --- plogical/upgrade.py | 2 +- websiteFunctions/StagingSetup.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 20db01bff..e25b4c295 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1262,7 +1262,7 @@ class Upgrade: for items in data: if items.find("CommonMiddleware") > -1: if csrfCheck == 1: - writeToFile.writelines(" 'django.middleware.common.CommonMiddleware',\n") + writeToFile.writelines(" 'django.middleware.csrf.CsrfViewMiddleware',\n") if items.find("'filemanager',") > -1: writeToFile.writelines(items) diff --git a/websiteFunctions/StagingSetup.py b/websiteFunctions/StagingSetup.py index 5f5d588c9..57d7af7ce 100644 --- a/websiteFunctions/StagingSetup.py +++ b/websiteFunctions/StagingSetup.py @@ -9,6 +9,7 @@ from plogical.mysqlUtilities import mysqlUtilities from random import randint import os + class StagingSetup(multi.Thread): def __init__(self, function, extraArgs): @@ -23,7 +24,7 @@ class StagingSetup(multi.Thread): elif self.function == 'startSyncing': self.startSyncing() except BaseException, msg: - logging.writeToFile( str(msg) + ' [StagingSetup.run]') + logging.writeToFile(str(msg) + ' [StagingSetup.run]') def startCloning(self): try: @@ -64,7 +65,8 @@ class StagingSetup(multi.Thread): masterPath = '/home/%s/public_html' % (masterDomain) - command = 'rsync -avzh --exclude "%s" --exclude "wp-content/plugins/litespeed-cache" %s/ %s' % (domain, masterPath, path) + command = 'rsync -avzh --exclude "%s" --exclude "wp-content/backups" --exclude "wp-content/updraft" --exclude "wp-content/cache" --exclude "wp-content/plugins/litespeed-cache" %s/ %s' % ( + domain, masterPath, path) ProcessUtilities.executioner(command, website.externalApp) logging.statusWriter(tempStatusPath, 'Data copied..,50') @@ -226,4 +228,4 @@ class StagingSetup(multi.Thread): return 0 except BaseException, msg: mesg = '%s. [404]' % (str(msg)) - logging.statusWriter(tempStatusPath, mesg) \ No newline at end of file + logging.statusWriter(tempStatusPath, mesg)