This commit is contained in:
Bozhidar 2024-05-16 14:02:12 +03:00
parent 08087255eb
commit 57379ac034
2 changed files with 8 additions and 13 deletions

View file

@ -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/',
];

View file

@ -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