mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
backuptestfinal1
This commit is contained in:
@@ -2652,18 +2652,6 @@ $parameters = array(
|
||||
newWPpath = wpsite.path
|
||||
newurl = wpsite.FinalURL
|
||||
|
||||
#### Check If sub dir in web site
|
||||
try:
|
||||
oldpath = config['WPsitepath']
|
||||
abc = oldpath.split("/")
|
||||
pathexta = abc[4]
|
||||
if pathexta != "":
|
||||
home = "0"
|
||||
else:
|
||||
home = "1"
|
||||
except BaseException as msg:
|
||||
home = "1"
|
||||
|
||||
### get WPsite Database name and usr
|
||||
php = PHPManager.getPHPString(PhpVersion)
|
||||
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
|
||||
@@ -2802,20 +2790,38 @@ $parameters = array(
|
||||
logging.statusWriter(self.tempStatusPath, 'Copying Data File...,50')
|
||||
###Copy backup content to newsite
|
||||
if home == "0":
|
||||
#### Check If sub dir in New web site
|
||||
try:
|
||||
kl = newWPpath.split("/")
|
||||
newpathexta = kl[4]
|
||||
if newpathexta != "":
|
||||
newsubdir = "0"
|
||||
else:
|
||||
newsubdir = "1"
|
||||
except BaseException as msg:
|
||||
newsubdir = "1"
|
||||
|
||||
if newsubdir == "0":
|
||||
unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath)
|
||||
###first split back to publich_html then mak dir and te copy
|
||||
b = newWPpath.rstrip('/')
|
||||
newwebpath = b.rstrip(newpathexta)
|
||||
command = "sudo -u %s mkdir %s%s" % (VHuser, newwebpath, pathexta)
|
||||
ProcessUtilities.executioner(command)
|
||||
Webnewpath = str(newwebpath) + str(pathexta)
|
||||
|
||||
else:
|
||||
unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath)
|
||||
###make dir of sub folder in existing site
|
||||
command = "sudo -u %s mkdir %s%s" % (VHuser, newWPpath, pathexta)
|
||||
ProcessUtilities.executioner(command)
|
||||
Webnewpath = str(newWPpath) + str(pathexta)
|
||||
|
||||
else:
|
||||
|
||||
unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath)
|
||||
###make dir of sub folder in existing site
|
||||
command = "sudo -u %s mkdir %s%s" % (VHuser, newWPpath, pathexta)
|
||||
ProcessUtilities.executioner(command)
|
||||
Webnewpath = str(newWPpath) + str(pathexta)
|
||||
else:
|
||||
unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (
|
||||
self.tempPath, oldtemppath)
|
||||
Webnewpath = newWPpath
|
||||
|
||||
###/usr/local/CyberCP/tmp/1755/ab/usr/local/CyberCP/tmp/8774/public_html
|
||||
###/usr/local/CyberCP/tmp/1755/ab/usr/local/CyberCP/tmp/8774/public_html/public_html/*
|
||||
|
||||
command = "sudo -u %s cp -R %s* %s" % (VHuser, unzippath, Webnewpath)
|
||||
result = ProcessUtilities.outputExecutioner(command)
|
||||
|
||||
@@ -2975,7 +2981,7 @@ $parameters = array(
|
||||
newurl = wpsite.FinalURL
|
||||
|
||||
|
||||
#### Check If sub dir in web site
|
||||
#### Check If sub dir in old web site
|
||||
try:
|
||||
oldpath = config['WPsitepath']
|
||||
abc = oldpath.split("/")
|
||||
@@ -2987,6 +2993,9 @@ $parameters = array(
|
||||
except BaseException as msg:
|
||||
home = "1"
|
||||
|
||||
|
||||
|
||||
|
||||
### get WPsite Database name and usr
|
||||
php = PHPManager.getPHPString(PhpVersion)
|
||||
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
|
||||
@@ -3039,14 +3048,35 @@ $parameters = array(
|
||||
logging.statusWriter(self.tempStatusPath, 'Copying Data File...,50')
|
||||
###Copy backup content to newsite
|
||||
if home == "0":
|
||||
#### Check If sub dir in New web site
|
||||
try:
|
||||
kl = newWPpath.split("/")
|
||||
newpathexta = kl[4]
|
||||
if newpathexta != "":
|
||||
newsubdir = "0"
|
||||
else:
|
||||
newsubdir = "1"
|
||||
except BaseException as msg:
|
||||
newsubdir = "1"
|
||||
|
||||
if newsubdir == "0":
|
||||
unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath)
|
||||
###first split back to publich_html then mak dir and te copy
|
||||
b = newWPpath.rstrip('/')
|
||||
newwebpath = b.rstrip(newpathexta)
|
||||
command = "sudo -u %s mkdir %s%s" % (VHuser, newwebpath, pathexta)
|
||||
ProcessUtilities.executioner(command)
|
||||
Webnewpath = str(newwebpath) + str(pathexta)
|
||||
|
||||
else:
|
||||
unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath)
|
||||
###make dir of sub folder in existing site
|
||||
command = "sudo -u %s mkdir %s%s" % (VHuser, newWPpath, pathexta)
|
||||
ProcessUtilities.executioner(command)
|
||||
Webnewpath = str(newWPpath) + str(pathexta)
|
||||
|
||||
unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath)
|
||||
###make dir of sub folder in existing site
|
||||
command = "sudo -u %s mkdir %s%s"%(VHuser, newWPpath, pathexta)
|
||||
ProcessUtilities.executioner(command)
|
||||
Webnewpath = str(newWPpath)+str(pathexta)
|
||||
else:
|
||||
##usr/local/CyberCP/tmp/4701/ab/usr/local/CyberCP/tmp/9507/public_html/public_html/
|
||||
|
||||
unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath)
|
||||
Webnewpath = newWPpath
|
||||
|
||||
|
||||
@@ -114,9 +114,9 @@
|
||||
|
||||
<tr>
|
||||
<td style="padding: 13px;">
|
||||
<a href="#">
|
||||
|
||||
<p style="font-weight: bold; text-transform: uppercase; ">{{ sub.id }}</p>
|
||||
</a>
|
||||
|
||||
</td>
|
||||
<td style="padding: 13px;">
|
||||
{{ sub.title }}
|
||||
|
||||
@@ -16,112 +16,119 @@
|
||||
</h2>
|
||||
<p>{% trans "On this page you can Restore, list, modify and delete Backups Wordpress Sites from your server." %}</p>
|
||||
</div>
|
||||
<span id="backupid" style="display: none">{{ backupobj.id }}</span>
|
||||
<span id="backuptype" style="display: none">{{ Backuptype }}</span>
|
||||
<div class="panel">
|
||||
<div class="panel-body">
|
||||
<h2 > {{ FileName }}</h2><img id="wordpresshomeloading" style="display: none" src="{% static 'images/loading.gif' %}">
|
||||
<h3 class="content-box-header">
|
||||
{{ FileName }} <img id="wordpresshomeloading" style="display: none"
|
||||
src="{% static 'images/loading.gif' %}"></h3>
|
||||
<div class="example-box-wrapper">
|
||||
|
||||
<span id="backupid" style="display: none">{{ backupobj.id }}</span>
|
||||
<span id="backuptype" style="display: none">{{ Backuptype }}</span>
|
||||
{% if Backuptype == "DataBase Backup" %}
|
||||
<div id="exinstingsitedivDB" ng-hide="installationDetailsForm" style="margin-top: 2%;"
|
||||
class="form-group">
|
||||
<label class="col-sm-2 control-label">{% trans "Choose WPsite Restore Destination " %}</label>
|
||||
<div class="col-sm-10">
|
||||
<select id="DesSite" class="form-control" required>
|
||||
<option value="-1">Select WordPress Site</option>
|
||||
{% for i in WPsites %}
|
||||
<option value="{{ i.id }}">{{ i.FinalURL }}</option>
|
||||
{% endfor %}
|
||||
<form name="websiteCreationForm" action="/" id="createPackages"
|
||||
class="form-horizontal bordered-row panel-body">
|
||||
{% if Backuptype == "DataBase Backup" %}
|
||||
<div id="exinstingsitedivDB" ng-hide="installationDetailsForm"
|
||||
class="form-group">
|
||||
<label class="col-sm-2 control-label">{% trans "Choose WPsite Restore Destination " %}</label>
|
||||
<div class="col-sm-10">
|
||||
<select id="DesSite" class="form-control" required>
|
||||
<option value="-1">Select WordPress Site</option>
|
||||
{% for i in WPsites %}
|
||||
<option value="{{ i.id }}">{{ i.FinalURL }}</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div ng-hide="installationDetailsForm" style="margin-top: 1%" class="form-group">
|
||||
<label class="col-sm-2 control-label">{% trans "Choose Restronig Method " %}</label>
|
||||
<div class="col-sm-10">
|
||||
<select ng-click="checkmethode()" id="RestoreMethode" class="form-control" required>
|
||||
<option value="-1">Selecte Methode</option>
|
||||
<option value="1">Restore to New Site</option>
|
||||
<option value="0">Restore to Existing Site</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div ng-hide="installationDetailsForm" class="form-group">
|
||||
<label class="col-sm-2 control-label">{% trans "Choose Restronig Method " %}</label>
|
||||
<div class="col-sm-10">
|
||||
<select ng-click="checkmethode()" id="RestoreMethode" class="form-control" required>
|
||||
<option value="-1">Select Method</option>
|
||||
<option value="1">Restore to New Site</option>
|
||||
<option value="0">Restore to Existing Site</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="exinstingsitediv" ng-hide="installationDetailsForm" style="margin-top: 4%; display: none"
|
||||
class="form-group">
|
||||
<label class="col-sm-2 control-label">{% trans "Choose WPsite Restore Destination " %}</label>
|
||||
<div class="col-sm-10">
|
||||
<select id="DesSite" class="form-control" required>
|
||||
<option value="-1">Select WordPress Site</option>
|
||||
{% for i in WPsites %}
|
||||
<option value="{{ i.id }}">{{ i.FinalURL }}</option>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div id="exinstingsitediv" ng-hide="installationDetailsForm" style="display: none"
|
||||
class="form-group">
|
||||
<label class="col-sm-2 control-label">{% trans "Choose WPsite Restore Destination " %}</label>
|
||||
<div class="col-sm-10">
|
||||
<select id="DesSite" class="form-control" required>
|
||||
<option value="-1">Select WordPress Site</option>
|
||||
{% for i in WPsites %}
|
||||
<option value="{{ i.id }}">{{ i.FinalURL }}</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="Newsitediv" ng-hide="installationDetailsForm" style="margin-top: 4%; display: none" class="form-group">
|
||||
<label class="col-sm-2 control-label">{% trans "Website Domain" %}</label>
|
||||
<div class="col-sm-10">
|
||||
<input name="Newdomain" id="Newdomain" type="url" placeholder="Enter New Website Domain for Restoring Website "
|
||||
class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
|
||||
<div ng-model="installationDetailsForm" class="col-sm-12 center-div" style="margin-top: 7%">
|
||||
<button id="RestoreWPbackupNow" type="button"
|
||||
ng-click="RestoreWPbackupNow()"
|
||||
class="btn btn-primary btn-lg center-div">{% trans "Restore Backup Now" %}</button>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="margin-top: 1%" ng-hide="installationProgress" class="form-group">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<div class="col-sm-7">
|
||||
|
||||
<div class="alert alert-success text-center">
|
||||
<h2>{$ currentStatus $}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div id="Newsitediv" ng-hide="installationDetailsForm" style="display: none"
|
||||
class="form-group">
|
||||
<label class="col-sm-2 control-label">{% trans "Website Domain" %}</label>
|
||||
<div class="col-sm-10">
|
||||
<input name="Newdomain" id="Newdomain" type="url"
|
||||
placeholder="Enter New Website Domain for Restoring Website "
|
||||
class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div ng-model="installationDetailsForm" class="col-sm-12 center-div">
|
||||
<button id="RestoreWPbackupNow" type="button"
|
||||
ng-click="RestoreWPbackupNow()"
|
||||
class="btn btn-primary btn-lg center-div">{% trans "Restore Backup Now" %}</button>
|
||||
</div>
|
||||
<div style="margin-top: 1%" ng-hide="installationProgress" class="form-group">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<div class="col-sm-7">
|
||||
|
||||
<div class="progress">
|
||||
<div id="installProgressbackup" class="progress-bar"
|
||||
role="progressbar" aria-valuenow="70"
|
||||
aria-valuemin="0" aria-valuemax="100"
|
||||
style="width:0%">
|
||||
<span class="sr-only">70% Complete</span>
|
||||
<div class="alert alert-success text-center">
|
||||
<h2>{$ currentStatus $}</h2>
|
||||
</div>
|
||||
|
||||
<div class="progress">
|
||||
<div id="installProgressbackup" class="progress-bar"
|
||||
role="progressbar" aria-valuenow="70"
|
||||
aria-valuemin="0" aria-valuemax="100"
|
||||
style="width:0%">
|
||||
<span class="sr-only">70% Complete</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="errorMessageBox" class="alert alert-danger">
|
||||
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
|
||||
<div ng-hide="success" class="alert alert-success">
|
||||
<p>{% trans "Backup succesfully created." %}</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-hide="couldNotConnect" class="alert alert-danger">
|
||||
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationProgress" class="form-group center-div">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" ng-disabled="goBackDisable"
|
||||
ng-click="goBack()"
|
||||
class="btn btn-primary btn-lg center-div">{% trans "Go Back" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="errorMessageBox" class="alert alert-danger">
|
||||
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
|
||||
<div ng-hide="success" class="alert alert-success">
|
||||
<p>{% trans "Backup succesfully created." %}</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-hide="couldNotConnect" class="alert alert-danger">
|
||||
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationProgress" class="form-group center-div">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" ng-disabled="goBackDisable"
|
||||
ng-click="goBack()"
|
||||
class="btn btn-primary btn-lg center-div">{% trans "Go Back" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -136,10 +136,10 @@
|
||||
<h6 style="font-weight: bold">Password Protection</h6>
|
||||
<div class="custom-control custom-switch">
|
||||
<input
|
||||
type="radio" data-toggle="modal"
|
||||
type="radio" data-toggle="modal"
|
||||
data-target="#Passwordprotection"
|
||||
class="custom-control-input ng-pristine ng-untouched ng-valid ng-not-empty"
|
||||
id="passwdprotection">
|
||||
class="custom-control-input ng-pristine ng-untouched ng-valid ng-not-empty"
|
||||
id="passwdprotection">
|
||||
<label class="custom-control-label"
|
||||
for="passwdprotection"></label>
|
||||
</div>
|
||||
@@ -163,18 +163,18 @@
|
||||
</div>
|
||||
<div class="modal-body" style="height: 100px;">
|
||||
|
||||
<div>
|
||||
<label class="col-sm-4">Username</label>
|
||||
<input required class="col-lg-8"
|
||||
type="text" placeholder="Username" >
|
||||
<div>
|
||||
<label class="col-sm-4">Username</label>
|
||||
<input required class="col-lg-8"
|
||||
type="text" placeholder="Username">
|
||||
|
||||
</div>
|
||||
<div style="margin-top: 36px;">
|
||||
<label class="col-sm-4">Password</label>
|
||||
<input required class="col-lg-8"
|
||||
type="password" placeholder="*******************" >
|
||||
</div>
|
||||
<div style="margin-top: 36px;">
|
||||
<label class="col-sm-4">Password</label>
|
||||
<input required class="col-lg-8"
|
||||
type="password" placeholder="*******************">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
@@ -419,67 +419,81 @@
|
||||
|
||||
</div>
|
||||
<div class="tab-pane" id="tab5">
|
||||
<h2>Create Backup Now</h2>
|
||||
<div class="col-sm-12" style="margin-top: 1%">
|
||||
<div class="col-sm-12">
|
||||
<label class="col-sm-3 control-label">{% trans "Select Backip type" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select id="backuptype" class="form-control">
|
||||
<option value="1">Website and DataBase Both</option>
|
||||
<option value="2">Only Website Data</option>
|
||||
<option value="3">Only DataBase</option>
|
||||
</select>
|
||||
<div class="panel-body">
|
||||
<h3 class="content-box-header">
|
||||
{% trans "Create Backup " %}
|
||||
</h3>
|
||||
<div class="example-box-wrapper">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 center-div" style="margin-top: 4%">
|
||||
<button id="createbackupbutton" type="button"
|
||||
ng-click="CreateBackup()"
|
||||
class="btn btn-primary btn-lg center-div">{% trans "Create Backup" %}</button>
|
||||
</div>
|
||||
<div style="margin-top: 1%" ng-hide="installationProgress" class="form-group">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<div class="col-sm-7">
|
||||
|
||||
<div class="alert alert-success text-center">
|
||||
<h2>{$ currentStatus $}</h2>
|
||||
<form name="websiteCreationForm" action="/" id="createPackages"
|
||||
class="form-horizontal bordered-row panel-body">
|
||||
<div ng-hide="installationDetailsForm" class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Select Backup type" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select id="backuptype" class="form-control">
|
||||
<option value="1">Website and Database Both</option>
|
||||
<option value="2">Only Website Data</option>
|
||||
<option value="3">Only Database</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationDetailsForm" class="form-group">
|
||||
<label class="col-sm-3 control-label"></label>
|
||||
<div class="col-sm-4">
|
||||
<button type="button" id="createbackupbutton"
|
||||
ng-click="CreateBackup()"
|
||||
class="btn btn-primary btn-lg">{% trans "Create Backup" %}</button>
|
||||
|
||||
<div class="progress">
|
||||
<div id="installProgressbackup" class="progress-bar"
|
||||
role="progressbar" aria-valuenow="70"
|
||||
aria-valuemin="0" aria-valuemax="100"
|
||||
style="width:0%">
|
||||
<span class="sr-only">70% Complete</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 1%" ng-hide="installationProgress"
|
||||
class="form-group">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<div class="col-sm-7">
|
||||
|
||||
<div class="alert alert-success text-center">
|
||||
<h2>{$ currentStatus $}</h2>
|
||||
</div>
|
||||
|
||||
<div class="progress">
|
||||
<div id="installProgressbackup" class="progress-bar"
|
||||
role="progressbar" aria-valuenow="70"
|
||||
aria-valuemin="0" aria-valuemax="100"
|
||||
style="width:0%">
|
||||
<span class="sr-only">70% Complete</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="errorMessageBox" class="alert alert-danger">
|
||||
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
|
||||
<div ng-hide="success" class="alert alert-success">
|
||||
<p>{% trans "Backup succesfully created." %}</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-hide="couldNotConnect" class="alert alert-danger">
|
||||
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationProgress" class="form-group center-div">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" ng-disabled="goBackDisable"
|
||||
ng-click="goBack()"
|
||||
class="btn btn-primary btn-lg center-div">{% trans "Go Back" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="errorMessageBox" class="alert alert-danger">
|
||||
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
|
||||
</div>
|
||||
|
||||
<div ng-hide="success" class="alert alert-success">
|
||||
<p>{% trans "Backup succesfully created." %}</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-hide="couldNotConnect" class="alert alert-danger">
|
||||
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="installationProgress" class="form-group center-div">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" ng-disabled="goBackDisable"
|
||||
ng-click="goBack()"
|
||||
class="btn btn-primary btn-lg center-div">{% trans "Go Back" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
<div class="d-lg-flex d-none justify-content-center">
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
a = "/home/habibackup.ml/public_html/////"
|
||||
a = "/home/folderhabitk.ml/public_html/subfile/"
|
||||
DomainName ="newweb3.com"
|
||||
abc = a.split("/")
|
||||
wpexpath = abc[4]
|
||||
|
||||
|
||||
b=a.rstrip('/')
|
||||
c= b.rstrip(wpexpath)
|
||||
newpath = '/home/%s/public_html/%s' % (DomainName, wpexpath)
|
||||
|
||||
if wpexpath != "":
|
||||
home = "0"
|
||||
else:
|
||||
home = "1"
|
||||
print(home)
|
||||
print(wpexpath)
|
||||
print(c)
|
||||
|
||||
Reference in New Issue
Block a user