From 14e8ef2ee9bd43f5e07dda11335080e14f290622 Mon Sep 17 00:00:00 2001 From: "usman@cyberpersons.com" Date: Tue, 21 Feb 2023 13:33:22 +0500 Subject: [PATCH 1/2] rustic example' --- plogical/Backupsv2.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/plogical/Backupsv2.py b/plogical/Backupsv2.py index bf1a5001c..f84f60a67 100644 --- a/plogical/Backupsv2.py +++ b/plogical/Backupsv2.py @@ -310,6 +310,31 @@ class CPBackupsV2: return 1 + def BackupRustic(self): + + ### This function will backup data of the website, also need to take care of directories that we need to exclude + ### excluded directories are in a list self.data['ExcludedDirectories'] only backup data if backupdata check is on + ## For example if self.data['BackupData'] is one then only run this function otherwise not + + destination = f'{self.FinalPath}/data' + source = f'/home/{self.website.domain}' + + ## Pending add user provided folders in the exclude list + + exclude = f'--exclude=.cache --exclude=.cache --exclude=.cache --exclude=.wp-cli ' \ + f'--exclude=backup --exclude=incbackup --exclude=incbackup --exclude=logs --exclude=lscache' + + command = f'mkdir -p {destination}' + ProcessUtilities.executioner(command, 'cyberpanel') + + command = f'chown {self.website.externalApp}:{self.website.externalApp} {destination}' + ProcessUtilities.executioner(command) + + command = f'rustic -r {source}/rusticbackup backup {source} --password "" {exclude}' + ProcessUtilities.executioner(command, self.website.externalApp) + + return 1 + def BackupEmails(self): ### This function will backup emails of the website, also need to take care of emails that we need to exclude From d81b1293934b76e54fb601602407edb606159574 Mon Sep 17 00:00:00 2001 From: "usman@cyberpersons.com" Date: Tue, 21 Feb 2023 13:37:15 +0500 Subject: [PATCH 2/2] rustic example --- serverStatus/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverStatus/views.py b/serverStatus/views.py index f943137fb..9439b37e7 100755 --- a/serverStatus/views.py +++ b/serverStatus/views.py @@ -455,7 +455,7 @@ def refreshLicense(request): {'domain': 'cyberpanel.net', 'BasePath': '/home/backup', 'BackupDatabase': 1, 'BackupData': 1, 'BackupEmails': 1}) cpbuv2.InitiateBackup() - cpbuv2.InstallRustic() + #cpbuv2.InstallRustic() final_dic = {'status': 1} final_json = json.dumps(final_dic)