From e6ed5094489aef122f29fbee8d1c1dd7a51a3786 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 18 Mar 2022 14:04:15 +0500 Subject: [PATCH] bug fix: https://community.cyberpanel.net/t/cyberpanel-delete-all-files-and-directors-public-html/31577/91 --- plogical/backupUtilities.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plogical/backupUtilities.py b/plogical/backupUtilities.py index 287657797..80128b3b1 100755 --- a/plogical/backupUtilities.py +++ b/plogical/backupUtilities.py @@ -368,11 +368,14 @@ class backupUtilities: ## Stop making archive of document_root and copy instead - # copy_tree('/home/%s/public_html' % domainName, '%s/%s' % (tempStoragePath, 'public_html')) - command = f'cp -R /home/{domainName}/public_html {tempStoragePath}/public_html' + from shutil import copytree - if ProcessUtilities.normalExecutioner(command) == 0: - raise BaseException(f'Failed to run {command}.') + + copytree('/home/%s/public_html' % domainName, '%s/%s' % (tempStoragePath, 'public_html')) + #command = f'cp -R /home/{domainName}/public_html {tempStoragePath}/public_html' + + # if ProcessUtilities.normalExecutioner(command) == 0: + # raise BaseException(f'Failed to run {command}.') # make_archive(os.path.join(tempStoragePath,"public_html"), 'gztar', os.path.join("/home",domainName,"public_html"))