@@ -605,7 +605,7 @@ def setwebrootpermissions(self, webroot):
605605 EEVariables .ee_php_user , recursive = True )
606606 except Exception as e :
607607 Log .debug (self , str (e ))
608- raise SiteError ("problem occured while settingup webroot permissions" )
608+ raise SiteError ("problem occured while setting up webroot permissions" )
609609
610610
611611def sitebackup (self , data ):
@@ -618,9 +618,14 @@ def sitebackup(self, data):
618618 .format (data ['site_name' ]), backup_path )
619619
620620 if data ['currsitetype' ] in ['html' , 'php' , 'proxy' , 'mysql' ]:
621- Log .info (self , "Backing up Webroot \t \t " , end = '' )
622- EEFileUtils .mvfile (self , ee_site_webroot + '/htdocs' , backup_path )
623- Log .info (self , "[" + Log .ENDC + "Done" + Log .OKBLUE + "]" )
621+ if (data ['pagespeed' ] is True or data ['old_pagespeed_status' ] is True ) and not data ['wp' ]:
622+ Log .info (self , "Backing up Webroot \t \t " , end = '' )
623+ EEFileUtils .copyfiles (self , ee_site_webroot + '/htdocs' , backup_path + '/htdocs' )
624+ Log .info (self , "[" + Log .ENDC + "Done" + Log .OKBLUE + "]" )
625+ else :
626+ Log .info (self , "Backing up Webroot \t \t " , end = '' )
627+ EEFileUtils .mvfile (self , ee_site_webroot + '/htdocs' , backup_path )
628+ Log .info (self , "[" + Log .ENDC + "Done" + Log .OKBLUE + "]" )
624629
625630 configfiles = glob .glob (ee_site_webroot + '/*-config.php' )
626631 if not configfiles :
@@ -653,7 +658,10 @@ def sitebackup(self, data):
653658 Log .info (self , "[" + Log .ENDC + "Done" + Log .OKBLUE + "]" )
654659 # move wp-config.php/ee-config.php to backup
655660 if data ['currsitetype' ] in ['mysql' , 'proxy' ]:
656- EEFileUtils .mvfile (self , configfiles [0 ], backup_path )
661+ if (data ['pagespeed' ] is True or data ['old_pagespeed_status' ] is True ) and not data ['wp' ]:
662+ EEFileUtils .copyfile (self , configfiles [0 ], backup_path )
663+ else :
664+ EEFileUtils .mvfile (self , configfiles [0 ], backup_path )
657665 else :
658666 EEFileUtils .copyfile (self , configfiles [0 ], backup_path )
659667
0 commit comments