Skip to content

Commit df33e63

Browse files
committed
[add] make zip file in a single command
1 parent d4e9f1b commit df33e63

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

server/lib/classes/cron.d/500-backup.inc.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ public function onRunJob() {
127127
if($backup_mode == 'userzip') {
128128
//* Create a .zip backup as web user and include also files owned by apache / nginx user
129129
$web_backup_file = 'web'.$web_id.'_'.date('Y-m-d_H-i').'.zip';
130-
$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);
131-
$retval = $app->system->last_exec_retcode();
132-
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);
130+
$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);
133131
$retval = $app->system->last_exec_retcode();
134132
} else {
135133
//* Create a tar.gz backup as root user

0 commit comments

Comments
 (0)