Skip to content
Snippets Groups Projects
Commit 90de6774 authored by Marius Burkard's avatar Marius Burkard
Browse files

Merge branch 'feature/improved-userzip' into 'stable-3.1'

Improved backup in `userzip` mode

See merge request ispconfig/ispconfig3!976
parents 3c8d69d5 df33e63a
No related branches found
No related tags found
No related merge requests found
...@@ -132,9 +132,7 @@ class cronjob_backup extends cronjob { ...@@ -132,9 +132,7 @@ class cronjob_backup extends cronjob {
if($backup_mode == 'userzip') { if($backup_mode == 'userzip') {
//* Create a .zip backup as web user and include also files owned by apache / nginx user //* Create a .zip backup as web user and include also files owned by apache / nginx user
$web_backup_file = 'web'.$web_id.'_'.date('Y-m-d_H-i').'.zip'; $web_backup_file = 'web'.$web_id.'_'.date('Y-m-d_H-i').'.zip';
$app->system->exec_safe('cd ? && sudo -u ? find . -group ? -print 2> /dev/null | zip -b ? --exclude=./backup\*'.$backup_excludes.' --symlinks ? -@', $web_path, $web_user, $web_group, $backup_tmp, $web_backup_dir.'/'.$web_backup_file); $app->system->exec_safe('cd ? && sudo -u ? find . -group ? -or -user ? -print 2> /dev/null | zip -b ? --exclude=./backup\*'.$backup_excludes.' --symlinks ? -@', $web_path, $web_user, $web_group, $http_server_user, $backup_tmp, $web_backup_dir.'/'.$web_backup_file);
$retval = $app->system->last_exec_retcode();
if($retval == 0 || $retval == 12) $app->system->exec_safe('cd ? && sudo -u ? find . -user ? -print 2> /dev/null | zip -b ? --exclude=./backup\*'.$backup_excludes.' --update --symlinks ? -@', $web_path, $web_user, $http_server_user, $backup_tmp, $web_backup_dir.'/'.$web_backup_file);
$retval = $app->system->last_exec_retcode(); $retval = $app->system->last_exec_retcode();
} else { } else {
//* Create a tar.gz backup as root user //* Create a tar.gz backup as root user
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment