bug fix: add incremental destination

This commit is contained in:
Usman Nasir
2020-04-29 04:46:01 +05:00
parent 6a9c774fcb
commit 3f1468c673
6 changed files with 13 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*- # -*- coding: utaddDestinationf-8 -*-
from django.shortcuts import render from django.shortcuts import render
from plogical.acl import ACLManager from plogical.acl import ACLManager
@@ -102,8 +102,14 @@ def addDestination(request):
execPath = execPath + " submitDestinationCreation --ipAddress " + ipAddress + " --password " \ execPath = execPath + " submitDestinationCreation --ipAddress " + ipAddress + " --password " \
+ password + " --port " + port + password + " --port " + port
if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(execPath)
output = ProcessUtilities.outputExecutioner(execPath) output = ProcessUtilities.outputExecutioner(execPath)
if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(output)
if output.find('1,') > -1: if output.find('1,') > -1:
content = '%s\n%s' % (ipAddress, port) content = '%s\n%s' % (ipAddress, port)

View File

@@ -159,6 +159,7 @@ check_root
echo -e "\nChecking OS..." echo -e "\nChecking OS..."
OUTPUT=$(cat /etc/*release) OUTPUT=$(cat /etc/*release)
if echo $OUTPUT | grep -q "CentOS Linux 7" ; then if echo $OUTPUT | grep -q "CentOS Linux 7" ; then
echo -e "\nDetecting CentOS 7.X...\n" echo -e "\nDetecting CentOS 7.X...\n"
SERVER_OS="CentOS7" SERVER_OS="CentOS7"

View File

@@ -196,6 +196,9 @@ class backupSchedule:
command = "sudo scp -o StrictHostKeyChecking=no -P "+port+" -i /root/.ssh/cyberpanel " + backupPath + " " + user + "@" + IPAddress+":~/backup/" + ipAddressLocal + "/" + time.strftime("%a-%b") + "/" command = "sudo scp -o StrictHostKeyChecking=no -P "+port+" -i /root/.ssh/cyberpanel " + backupPath + " " + user + "@" + IPAddress+":~/backup/" + ipAddressLocal + "/" + time.strftime("%a-%b") + "/"
subprocess.call(shlex.split(command), stdout=writeToFile) subprocess.call(shlex.split(command), stdout=writeToFile)
if os.path.exists(ProcessUtilities.debugPath):
logging.CyberCPLogFileWriter.writeToFile(command)
## Remove backups already sent to remote destinations ## Remove backups already sent to remote destinations
os.remove(backupPath) os.remove(backupPath)

View File

@@ -493,7 +493,6 @@ class backupUtilities:
items.status = 1 items.status = 1
items.size = totalSize items.size = totalSize
items.save() items.save()
logging.CyberCPLogFileWriter.writeToFile(' again size: %s' % (totalSize))
except BaseException as msg: except BaseException as msg:
logging.CyberCPLogFileWriter.writeToFile('%s. [backupRoot:499]' % str(msg)) logging.CyberCPLogFileWriter.writeToFile('%s. [backupRoot:499]' % str(msg))
for items in backupObs: for items in backupObs:

View File

@@ -416,7 +416,7 @@ app.controller('restoreWebsiteControl', function ($scope, $http, $timeout) {
}); });
//*** Resotre site ends here ***/// //*** Restore site ends here ***///
///** Backup Destination ***// ///** Backup Destination ***//
@@ -448,6 +448,7 @@ app.controller('backupDestinations', function ($scope, $http, $timeout) {
var data = { var data = {
IPAddress: $scope.IPAddress, IPAddress: $scope.IPAddress,
password: $scope.password, password: $scope.password,
user: $scope.user,
backupSSHPort: $scope.backupSSHPort, backupSSHPort: $scope.backupSSHPort,
}; };

View File

@@ -1479,7 +1479,6 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
// Download files // Download files
$scope.downloadFile = function () { $scope.downloadFile = function () {
url = "/filemanager/downloadFile"; url = "/filemanager/downloadFile";
var downloadURL = $scope.currentPath + "/" + allFilesAndFolders[0]; var downloadURL = $scope.currentPath + "/" + allFilesAndFolders[0];
window.location.href = url + '?domainName=' + domainName + '&fileToDownload=' + downloadURL; window.location.href = url + '?domainName=' + domainName + '&fileToDownload=' + downloadURL;