Skip to content

Commit c27eb05

Browse files
committed
CP-16: Admin Back Up Start Transfer
1 parent 97ab0ab commit c27eb05

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

backup/backupManager.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,9 @@ def starRemoteTransfer(self, userID=None, data=None):
11421142
command = "sudo mkdir " + localStoragePath
11431143
ProcessUtilities.executioner(command)
11441144

1145+
command = 'chmod 600 %s' % (localStoragePath)
1146+
ProcessUtilities.executioner(command)
1147+
11451148
final_json = json.dumps(
11461149
{'remoteTransferStatus': 1, 'error_message': "None", "dir": data['dir']})
11471150
return HttpResponse(final_json)

plogical/remoteTransferUtilities.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ def remoteTransfer(ipAddress, dir, accountsToTransfer):
6969
if not os.path.exists(destination):
7070
os.makedirs(destination)
7171

72+
command = 'chmod 600 %s' % (destination)
73+
ProcessUtilities.executioner(command)
74+
7275
writeToFile = open(backupLogPath, "w+")
7376

7477
writeToFile.writelines("############################\n")
@@ -144,6 +147,11 @@ def backupProcess(ipAddress, dir, backupLogPath, folderNumber, accountsToTransfe
144147

145148
completePathToBackupFile = retValue[1] + '.tar.gz'
146149

150+
### change permissions of backup file
151+
152+
command = 'chmod 600 %s' % (completePathToBackupFile)
153+
ProcessUtilities.executioner(command)
154+
147155
## move the generated backup file to specified destination
148156

149157
if os.path.exists(completePathToBackupFile):

0 commit comments

Comments
 (0)