From 57379ac0346dbb55b1c823a9583abbd89b075790 Mon Sep 17 00:00:00 2001 From: Bozhidar Date: Thu, 16 May 2024 14:02:12 +0300 Subject: [PATCH] update --- .../Microweber/MicroweberBackupConfig.php | 16 +++++----------- web/app/Models/Backup.php | 5 +++-- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/web/Modules/Microweber/MicroweberBackupConfig.php b/web/Modules/Microweber/MicroweberBackupConfig.php index feccb7c..4b6b26a 100644 --- a/web/Modules/Microweber/MicroweberBackupConfig.php +++ b/web/Modules/Microweber/MicroweberBackupConfig.php @@ -8,17 +8,11 @@ class MicroweberBackupConfig extends BackupConfigBase { public array $excludePaths = [ - '/home/*/public_html/storage/framework/cache/*', - '/home/*/public_html/storage/framework/views/*', - '/home/*/public_html/userfiles/cache/*', - '/home/*/public_html/userfiles/media/thumbnails/*', - '/home/*/public_html/storage/framework/sessions/*', - - '/home/*/domains/*/public_html/storage/framework/cache/*', - '/home/*/domains/*/public_html/storage/framework/views/*', - '/home/*/domains/*/public_html/userfiles/cache/*', - '/home/*/domains/*/public_html/userfiles/media/thumbnails/*', - '/home/*/domains/*/public_html/storage/framework/sessions/*', + '/public_html/storage/framework/cache/', + '/public_html/storage/framework/views/', + '/public_html/userfiles/cache/', + '/public_html/userfiles/media/thumbnails/', + '/public_html/storage/framework/sessions/', ]; diff --git a/web/app/Models/Backup.php b/web/app/Models/Backup.php index ec54639..8f1210a 100644 --- a/web/app/Models/Backup.php +++ b/web/app/Models/Backup.php @@ -265,7 +265,7 @@ class Backup extends Model // cp -r (copy recursively, also copy hidden files) // $shellFileContent .= 'cp -r /home/' . $hostingSubscription->system_username . '/ ' . $hostingSubscriptionsMainPath . PHP_EOL; - $shellFileContent .= "rsync -av --exclude-from='$excludeListPath' /home/$hostingSubscription->system_username/ " . $hostingSubscriptionPath . PHP_EOL; + $shellFileContent .= "rsync -av --exclude-from='$excludeListPath' /home/$hostingSubscription->system_username/ " . $hostingSubscriptionPath .'/'. PHP_EOL; $shellFileContent .= 'mkdir -p ' . $hostingSubscriptionPath . '/databases' . PHP_EOL; @@ -286,6 +286,7 @@ class Backup extends Model } $shellFileContent .= PHP_EOL; + break; } } @@ -298,7 +299,7 @@ class Backup extends Model $shellFileContent .= 'echo "Backup complete"' . PHP_EOL; $shellFileContent .= 'touch ' . $backupPath. '/backup.done' . PHP_EOL; $shellFileContent .= 'rm -rf ' . $backupTempScript; - + file_put_contents($backupTempScript, $shellFileContent); // chmod read and delete by owner only