From c27eb05522610b89010bc69458866fcdfcafb5eb Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 13 Aug 2021 12:34:23 +0500 Subject: [PATCH] CP-16: Admin Back Up Start Transfer --- backup/backupManager.py | 3 +++ plogical/remoteTransferUtilities.py | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/backup/backupManager.py b/backup/backupManager.py index c42b706d6..902f3e3ab 100755 --- a/backup/backupManager.py +++ b/backup/backupManager.py @@ -1142,6 +1142,9 @@ class BackupManager: command = "sudo mkdir " + localStoragePath ProcessUtilities.executioner(command) + command = 'chmod 600 %s' % (localStoragePath) + ProcessUtilities.executioner(command) + final_json = json.dumps( {'remoteTransferStatus': 1, 'error_message': "None", "dir": data['dir']}) return HttpResponse(final_json) diff --git a/plogical/remoteTransferUtilities.py b/plogical/remoteTransferUtilities.py index 76a1ef5c0..7dabc3a84 100755 --- a/plogical/remoteTransferUtilities.py +++ b/plogical/remoteTransferUtilities.py @@ -69,6 +69,9 @@ class remoteTransferUtilities: if not os.path.exists(destination): os.makedirs(destination) + command = 'chmod 600 %s' % (destination) + ProcessUtilities.executioner(command) + writeToFile = open(backupLogPath, "w+") writeToFile.writelines("############################\n") @@ -144,6 +147,11 @@ class remoteTransferUtilities: completePathToBackupFile = retValue[1] + '.tar.gz' + ### change permissions of backup file + + command = 'chmod 600 %s' % (completePathToBackupFile) + ProcessUtilities.executioner(command) + ## move the generated backup file to specified destination if os.path.exists(completePathToBackupFile):