Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ISPConfig 3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Dirk Dankhoff
ISPConfig 3
Commits
b48a0b43
Commit
b48a0b43
authored
Sep 04, 2015
by
Florian Schaal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow empty backup-dir (to disable backups on a server, just empty the backup-dir)
parent
aff9acb4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
7 deletions
+10
-7
interface/web/admin/form/server_config.tform.php
interface/web/admin/form/server_config.tform.php
+1
-3
server/lib/classes/cron.d/500-backup.inc.php
server/lib/classes/cron.d/500-backup.inc.php
+1
-1
server/lib/classes/cron.d/500-backup_mail.inc.php
server/lib/classes/cron.d/500-backup_mail.inc.php
+1
-1
server/plugins-available/backup_plugin.inc.php
server/plugins-available/backup_plugin.inc.php
+7
-2
No files found.
interface/web/admin/form/server_config.tform.php
View file @
b48a0b43
...
...
@@ -169,9 +169,7 @@ $form["tabs"]['server'] = array(
'datatype'
=>
'VARCHAR'
,
'formtype'
=>
'TEXT'
,
'default'
=>
'/var/backup'
,
'validators'
=>
array
(
0
=>
array
(
'type'
=>
'NOTEMPTY'
,
'errmsg'
=>
'backup_dir_error_empty'
),
1
=>
array
(
'type'
=>
'REGEX'
,
'validators'
=>
array
(
0
=>
array
(
'type'
=>
'REGEX'
,
'regex'
=>
'/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/'
,
'errmsg'
=>
'backup_dir_error_regex'
),
),
...
...
server/lib/classes/cron.d/500-backup.inc.php
View file @
b48a0b43
...
...
@@ -52,7 +52,7 @@ class cronjob_backup extends cronjob {
$server_config
=
$app
->
getconf
->
get_server_config
(
$conf
[
'server_id'
],
'server'
);
$global_config
=
$app
->
getconf
->
get_global_config
(
'sites'
);
$backup_dir
=
$server_config
[
'backup_dir'
]
;
$backup_dir
=
trim
(
$server_config
[
'backup_dir'
])
;
$backup_mode
=
$server_config
[
'backup_mode'
];
if
(
$backup_mode
==
''
)
$backup_mode
=
'userzip'
;
...
...
server/lib/classes/cron.d/500-backup_mail.inc.php
View file @
b48a0b43
...
...
@@ -54,7 +54,7 @@ class cronjob_backup_mail extends cronjob {
$mail_config
=
$app
->
getconf
->
get_server_config
(
$conf
[
'server_id'
],
'mail'
);
$global_config
=
$app
->
getconf
->
get_global_config
(
'sites'
);
$backup_dir
=
$server_config
[
'backup_dir'
]
;
$backup_dir
=
trim
(
$server_config
[
'backup_dir'
])
;
$backup_dir_permissions
=
0750
;
$backup_mode
=
$server_config
[
'backup_mode'
];
...
...
server/plugins-available/backup_plugin.inc.php
View file @
b48a0b43
...
...
@@ -71,7 +71,9 @@ class backup_plugin {
$web
=
$app
->
dbmaster
->
queryOneRecord
(
"SELECT * FROM web_domain WHERE domain_id = ?"
,
$backup
[
'parent_domain_id'
]);
$server_config
=
$app
->
getconf
->
get_server_config
(
$conf
[
'server_id'
],
'server'
);
$backup_dir
=
$server_config
[
'backup_dir'
]
.
'/web'
.
$web
[
'domain_id'
];
$backup_dir
=
trim
(
$server_config
[
'backup_dir'
]);
if
(
$backup_dir
==
''
)
return
;
$backup_dir
.
=
'/web'
.
$web
[
'domain_id'
];
$backup_dir_is_ready
=
true
;
//* mount backup directory, if necessary
...
...
@@ -178,7 +180,10 @@ class backup_plugin {
$app
->
uses
(
'ini_parser,file,getconf'
);
$server_config
=
$app
->
getconf
->
get_server_config
(
$conf
[
'server_id'
],
'server'
);
$backup_dir
=
$server_config
[
'backup_dir'
];
$backup_dir
=
trim
(
$server_config
[
'backup_dir'
]);
if
(
$backup_dir
==
''
)
return
;
$backup_dir_is_ready
=
true
;
//* mount backup directory, if necessary
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment